It is possible for you to function on only 5 hours of sleep per night if that's all you can get.
I sometimes only get 5 and even 4 hours of sleep some nights and function okay the next day but I function even better if I can get the 8 hours of sleep that is required.
But it's rare for me to get 8 hours of sleep per night because I sometimes suffer from Insomnia and I have to be up very early to get to work the next morning.
Only on the weekends do I sometimes get the 8 hours of sleep and when I do I function a lot better.
So aim to get 8 hours of sleep per night if you can as you'll feel much better the next day and be more alert but if you can't then 5 hours of sleep can allow you to function still.