In case it isn't obvious to anyone still in school, DO NOT pull all-nighters (especially not multiple ones) to study. Ideally, study outside of your sleep time.
But let's say you were too busy (for valid reasons, not cuz you were goofing off). And, let's say you'd only get 60% without studying, or 90% if you studied all the material. If you miss like 8 hours of sleep to do that, your performance might go from 90% to 75%. If you miss 24 hours of sleep over 3 days, that might go down to like 30%, so you'd be better off just sleeping and not studying at all (the numbers are made up but it's in the same ballpark). Not to mention, more than affecting your grades, it'll do long term damage to your health.