Re: Licensing
I don't believe that the NEC addresses that issue specifically (as other respondents have pointed out). It really comes down to a question of liability. I believe that in most states homeowners are permitted to do electrical work on their own primary residences but they can't contract with the public to do work on other residences or do commercial work.
If you stop and think about contractual obligations (in general), if I contract with my neighbor to upgrade his/her electrical service I will take out a permit, do the work and get it inspected. If any problems (or God forbid a fire) occur thereafter I am covered by my insurance. In contrast, if I walk over to my neighbor's house, while HE/SHE is upgrading their electrical service, and offer to lend a hand and/or offer some advice, if any of the aforementioned situations occur - HE/SHE can sue me personally.
Plumbers, general contractors, handymen, etc. all know the limit of their abilities, but it starts getting dangerous when they begin dabbling in electrical work. I can't begin to tell you how many times I find AC cables stubbed into plastic , nail-on boxes, wires spliced in open air and ungrounded in attics, std. RX cable direct buried 6" in front lawns to cite a few instances.
Of course, if you don't pull a permit - I guess you can do anything you want to !!!