Enrollment duration can be set for students using the enrollment settings in your course. Now with the Enrollment Timer Block (available for Moodle 2.5 – 2.7) you can display this information to enrolled students so that they aren’t surprised when they suddenly can’t access their course any longer.
The block is maintained by Aaron Leggett, according to the description,
Emailing functionality is also included, You can enable students be notified by email that their enrolment is expiring in a set amount of days (Default 10). Email notifications can also be enabled to congratulate a student on passing the course. This email is sent after the student receives a required grade in the course_total grade.
If you’re selling courses or want to keep enrollment durations to a specific timeframe, this block is a great way to cue your students to their remaining time to study.