"The time of the exam" will usually mean "the time appointed for the exam to start".
The time of the exam is 2:00 pm.
(You might encounter a durational sense in "The student finished the exam with a time of one hour and forty-five minutes"—but this would be his time "in the exam" or "for the exam" not "of the exam".)
"The time for the exam" might mean either "the time appointed for the exam to start" or "the time allotted for the exam to last" or (as in my parenthesis above) "the time actually spent on the exam". In your context it's clear which is meant, but you would do better to eliminate ambiguity and write "The time allotted for" or "The time allowed for".
(To make things even more confusing, you could also write "the time allotted to the exam". In most cases this would be frowned on, because the time is ordinarily allotted to the student for the exam. But it might be allotted to the exam on a schedule: "Our program allots six hours to lectures and two hours to the exam.")
"I have to speed up my problem solving" is perfectly OK, but more detailed than it's likely to be expressed in ordinary speech. "I have to work faster" or "I have to speed up" are more likely. "Gotta" for "I have to" is yet more likely.