It depends on the type of exam. If it's just an annual vision
test, then right away should be fine.
If your eyes were dilated, then you need to wait till your pupils return to normal. You eye
doc should give you this information at the time of your exam.
Answer assisted by David Miller, Medical Student