I'm a bit confused by the possible situation, but the sentence is phrased correctly. [ What time did I go to bed? What time did I get up? Let's see how many hours I slept. ]
You're properly using 'slept' as a past-tense verb, so it would be correct to use it in that manner. tl;dr, Yes, it can be said, and that's the appropriate speech.