All mammals need to enter an unconscious state every now and then to be able to function properly. Cetaceans are concious breathers, meaning they have to actively decide whether or not to breathe. Whales show unihemispheric slow-wave sleep, they simply let one half of the brain stay asleep while the other half stays concious so that the whale can rise to the surface to breathe when needed. Some cetaceans, like the Sperm whale, have been found drifting around motionless during this state.
Sleeping Sperm whales.