There are likely booking plugins you could utilize. They may be a bit overkill for your needs, but they would save you a lot of development time.
If you would rather roll your own so you can further your PHP skills, that’s fine too. Start with the most basic approach possible at first. You can trick it out later. Each time slot could be represented by an indexed array of slots. Each element could be another array of data used by each slot: A string label of what time span the slot covers and the remaining unclaimed spots. For example:
$contest_data = [
['avail'=> 5, 'time'=>'day'],
['avail'=> 5, 'time'=>'night'],
]
‘time’ value can be any arbitrary time span, a few minutes, a few years, they’re just labels. Output the labels as a list of links. Clicking any link takes one to provide registration data, if not previously collected. Once all the user data has been collected and verified, send a request to the server along with the data array index # picked by the user. In my example, it will be either 0 or 1.
When the server receives the request, it can store the selected slot in user meta of the current user. Also, the contest data array’s “avail” value must be deducted from the proper slot. This array could be stored as an option value.