18 is okay. Of course, at that age one might attract unwanted attention, but it's not illegal.
Per 18 Pa.C.S. § 6110.1 (Possession of firearm by minor), the minimum age to possess a firearm is 18 with two exceptions:
1. The minor is under the supervision of a parent, grandparent, legal guardian, or an adult acting with the expressed consent of the minor's parent or legal guardian and involved in lawful activity.
2. The minor is lawfully involved in hunting or trapping activities.
Section 6110.1 says you can't carry if under 18. Since the law states what you cannot do, what you can do is unstated. Ergo, ipso facto, qui pro quo, et cetera, and a bunch of other Latin terms, if it's not illegal, then it's legal.
Under 21 you can't get an LTCF, nor can you normally carry in a vehicle (unless going directly to or from a range or gun dealer), nor can an FFL handle a transfer to you. Parents or grandparents can gift you a handgun, however, with no restrictions (unless, of course, you're already a prohibited person).