You can set a time limit by simply going into your assignment/exam configuration and turn the advance configuration on. The time limit configuration is located right below the assignment groups. 




Time Limit


This option will allow you to limit the time spent on an assignment. The minimum time limit that can be assigned is 1 min and the maximum is 23 hours 59 mins.