The temptation in senior year is to trade sleep for study hours. The trade is very bad. A tired brain encodes less, retrieves less, and produces more careless mistakes on timed papers.
Aim for at least seven hours a night through most of the year and at least eight in the last month. If you cannot make this work with your current schedule, cut something else — not sleep.
The exception is not 'the night before an important test'. That is exactly the night sleep matters most. A well-rested student outperforms a slightly-better-prepared exhausted one on almost every measurable dimension of exam performance.
Naps of 20-30 minutes in the afternoon are a real study tool, not a luxury. They restore attention and consolidate what you learned in the morning.
Coffee helps for two hours and hurts for eight. Time it deliberately. Do not drink coffee after 2 PM in the last month if you value your sleep.