Depending on a person's age, they should get between 7 and 10 hours of sleep the night before taking a test. Even more importantly, students should do their best to get the right amount of sleep every night in the weeks leading up to a test.