You may set a time limit for your courses. This means that a user may access the course for this interval after they have enrolled. In order to do this, edit the course you want and move to the course Properties (1). Open the advanced settings and you will find the Available for (2) option.
Note: this is a per user time limit, meaning that it starts counting from the day that each user enrolled to the course.
You can specify a more strict and detailed time limit if you wish using the Available from (3) and Available until (4) options in your course's advanced settings.
This means that your users will be able to take this course only in the period that you have defined with the above options.
Note: the availability period is the same for all users, no matter of when they took the course.