It has been said for years that people need at least 8 hours of sleep per night or whenever they sleep to function properly when awake.
But most people only get around 6 to 7 hours of sleep per night and they function okay but if you can get 8 hours of sleep per night that would be much better for your health.
I'm less alert and do not function as good in the daytime when I get less than 8 hours of sleep so I always try to aim for getting 8 hours of sleep per night if possible.
But sometimes I may only get 6 or 7 hours of sleep at night and I still function okay during the day but would function better if I were to get that 8 hours of sleep.
Still if all you can get is 5 or 7 hours of sleep at night then it's better than no sleep at all.
But a study out of UCSD says that getting only 5 hours of sleep is better for you than 8 but it can vary depending on the person as some need 8 hours of sleep while others are okay with less hours of sleep.