9 hours is recommended, but I really think it should be 10, so I'd recommend any time between 9pm and 10pm. Electrical devices should be switched off by 8pm though, otherwise you'll be asleep by 12am. I replace electrical devices with books :) Hope this helps :)
Expanding on what Niamh said I normally used to plug in my phone for the night in another room to get rid of the temptation, but yeah if you are looking to be at your best on the next day 9 or so hours is what you should go for :)