In the Courses tab, view the Visibility section. By default, student access checkboxes are not selected, meaning students can view courses before and after course dates. To retain this default for the course, do not select any checkboxes.
To set a default so that students cannot view a link to the course before the course start date, click the Restrict students from viewing courses before start date checkbox [1].
To set a default so that students cannot access the course after the course end date, Restrict students from viewing courses after end date checkbox [2].