You should study for the real estate exam for at least several weeks before your test date. The whole point of taking your pre-licensing courses is to prepare you, first for the exam, and then for your work as an agent, so really, you should be thinking of your courses as exam prep time as well.