You can control the length of exams by setting a beginning and end time between which a student can take the exam.
You can also set a time limit which starts once the student has started the exam.
To do so, go to the "settings" tab of your course and change the duration settings: