I'll give this a try, but remember that I am not qualified to give legal advice, so if there is any question, consult an attorney or read the appropriate laws. Also, this is a very brief summary; I have not tried to cover all contingencies or answer all questions.
If the gun is a machinegun, short barrel rifle (under 16 inch barrel), short barrelled shotgun (under 18 inch barrel) or other firearm controlled under Title II of GCA 68, it must have been previously registered with the federal government and must be transferred under their rules with transfer taxes paid. An interstate sale must be made through a person licensed to deal in that type of firearm. State and local laws must also be obeyed.
If the gun is an "ordinary" rifle or shotgun, you can sell it to anyone in the U.S. as long as you do not violate the laws of your state or the state of the buyer in doing so. But you may not ship the gun across state lines, except to a dealer. If the sale is entirely within a state, with you and the buyer both residents of that state, state law prevails; there is no covering federal law. Note that some states control rifles and shotguns they designate as "assault weapons" differently than "ordinary" rifles and shotguns.
If the gun is a handgun, you cannot sell it directly to a resident of another state; it must be shipped through an FFL holder in the buyer's state. Again, within a state, state and local law prevail.
If the gun is an antique, made before 1898, or does not use fixed ammunition (i.e., is a muzzle loader) there are no federal restrictions, but there may be state or local laws.
Jim