It's not how many hours you sleep, but if you complete or not a REM cycle. If you sleep 20h then wake up in the middle of the REM cycle, you will feel tired. Conversely, if you only sleep 3h but fully complete the cycle, the brain will be refreshed.
There are free sleep calculators online to help you gauge the hour you should fall asleep by in order to get the best quality sleep.