cram for an/the exam
To study for a test shortly before it is to happen. You might have gotten a higher grade if you didn't cram for the exam at the last minute.
sit for (some)/(one's) exam
To take an examination in a formal setting or situation. You will have all your personal belongings inspected before you sit for the exam to ensure that no one is able to cheat. It was only when I sat for my final exam that I realized I had left my calculator at home. If my teacher hadn't convinced me to sit for the SAT, I never would have gotten into college.
sit for an exam
to take an exam to qualify for a license, such as a bar exam. When do you sit for the bar exam? I will sit for the exam next week.