Hi Bianca
There are some options in enrolment methods to have an expiry date for a course and set an enrolment expiration action.
The manual ,self enrolment and Flat file methods have the expiry option - depending on how you want to enrol users you could use one of these.
Regards