The next time you apply for anything that depends on your credit history, the collections history will show up on the credit report (assuming you’re in a country that has those - far more than just the US) and either cause your application to be refused or to be approved with bad terms. This will stay on the credit report for years.
It’s probably not worth anyone’s time to go after you more aggressively than that merely for the amount of a gym membership, but if they so choose they’re absolutely allowed to sue you to get a court judgment which appropriate authorities will enforce for them against your assets and income. For larger debts, this is in no way unlikely, if they think you can afford to pay.
To be clear, I support the proposed FTC rule and think it should be as easy to cancel as to sign up. But that procedural question is separate from what commitments may exist. for example, if they give you a discount for a 12-month commitment but still allow you to pay monthly, or if they only offer memberships with a minimum commitment of 12 months, canceling in month 3 would very reasonably still require you to pay the rest of the current 12-month term before your obligation ends.
For some contracts, I can imagine allowing the alternative of repaying the amount of the discount received so far due to the annual commitment, plus interest on that amount. But if you received and used any perks through the annual commitment which would otherwise not have been available to you, or if they incur significant upfront costs for new members which are amortized across the first 12 months of membership, allowing this would not produce a fair outcome.