To maximize gains and recovery?
fukk that generic shyt breh.
Some people need more to see results
Your question was also kinda generic. Gains in what, strength or size? Answer also depends on what I'm eating and taking.
Back when GoT was on (or during football season), it's not uncommon for me to roll into the gym on 2-3 hours of sleep Monday morning, especially if I'm doing a hypertrophy-based or less neurally-intense split. Go to sleep around midnight, get up by 3, and spend almost 3 hours on PPL or PHAT? Easy.
If I'm on my Bulgarian Method shyt, I'm usually logging 8 plus. Not uncommon for me to push 10 hours and still need a nap later.
Even though the sets are shorter and the workouts are less dense, they drain my nervous system much more. If I have a bad week of sleep, my ass is toast.
So, to answer your question, anywhere from 2-10 plus hours a night, depending on what I'm doing in the gym, and I can get away with less and less sleep the greater my caloric surplus is.