Does consciousness cease, like a candle flame blown out, when we are in deep dreamless sleep? It's an interesting question. Although not aware of anything at that time, it seems that consciousness must still be present because we'll awaken to sounds and other sensory stimuli. So what's happening?
According to Chapter 1, sutra 10, of the Yoga Sutras of Patanjali, when we are in deep dreamless sleep, although consciousness remains aware, our mind is filled at that time with a single thought of blankness, of nothingness. Thus, we are conscious of nothing.
This is why, after awakening, we can remember that we were sleeping and have a sense of whether it was a good sleep or not. If consciousness was extinguished at that time, we would have no such sense.