You can take the exam before you graduate or afterwards.
(Speaking from experience) the closer you take the exam to taking your college courses, the better.
Some colleges/departments provide funding to assist with taking the exam if you do it while still a student.