Gyms are well known/infamous for ripping people off. I would never recommend paying upfront. Sure you're solving the problem of cc charges, but instead you're taking on the risk of the gym closing. And that happens all the time. And if you think it's a chain so you'll still be covered at another location, guess again. Those other locations will say they have no record of your payment and/or they won't recognize your membership.
Whenever I have quit a gym I put my notice in writing, state the last expected bill date (make sure you account for any notice period, usually something like 30 days), hand deliver it (and make note of who you handed it to), and keep a copy for your records.
If you end up having to go to small claims court, it works wonders to be able to say you delivered a copy of this letter you have in your hand to Bob at 4:37 pm on July 8th. Case closed. Especially when the gym has nothing more than their words that they never got anything.
Now if it takes you 6 months to notice on your cc statement that you're still being billed, shame on you.