The temptation 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 your schedule cannot accommodate that, 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. No coffee after 2 p.m. in the last month if you value your sleep.