The very basic answer is that you can make a gun
for your own personal use as long as it's a legal firearm for you to own.
The big thing for a pistol is that you can't make a smoothbore pistol unless you already have all the approvals/paperwork/registration/taxes taken care of.
The other obvious pitfall is that if you start making
and selling guns, you're going to attract some very unwelcome attention.
http://www.atf.gov/firearms/faq/general.html#gca-manufacturing
Q: Does the GCA prohibit anyone from making a handgun, shotgun or rifle?
With certain exceptions a firearm may be made by a non-licensee provided it is not for sale and the maker is not prohibited from possessing firearms. However, a person is prohibited from assembling a non-sporting semi-automatic rifle or non-sporting shotgun from imported parts. In addition, the making of an NFA firearm requires a tax payment and approval by ATF. An application to make a machine gun will not be approved unless documentation is submitted showing that the firearm is being made for a Federal or State agency.
[18 U.S.C. 922(o) and (r), 26 U.S.C. 5822, 27 CFR 478.39, 479.62 and 479.105]