Depends in the area you live in, and how memberships work in terms of certain fees. Generally the guidelines for most gyms are if you're 14 years of age, you can join a gym, but must have adult supervision until you're 16 or 17 years of age. Memberships vary depending how mainstream the gym is and can be anywhere from $10-70/month, or $120-840/year.
For me, my gym allows anyone over the age of 16 to train alone and membership fee is $10/month or $120/year. It's cheap because it's not a mainstream gym, meaning all we have is free-weight, a few machines, and some cardio machines with a separate section for tanning beds. Mainstream gyms like L.A. Fitness or Gold's Gym will probably charge more because they have pools/spas and loads of other things.