You can access this feature in the assignment Options menu.
Below is what students see when they click on a locked assignment.
An instructor can also lock or unlock all the assignments of a course by selecting corresponding options from the course Options menu.