You'll likely want to decide when a customer can no longer register for a class. For example it may be that you need to know final class numbers at least 5 hours before the class starts.
Head to Settings>>Registration to get started.
Advanced settings allow you to set different cutoff times for each class.
It may be that you are less worried about letting a customer book onto your popular classes close to the start time vs wanting lots of warning for classes you need to arrange an instructor for i.e. 1 on 1 sessions.
You may also need to let customers register for a class after it starts i.e. Open Gym where there is one long session that runs continuously throughout the day.