This is one of those curious-5-year-old questions, but I will nevertheless answer it fully because it’s a cool topic. Sleep is actually essential to all animals and is present in every group that has been studied. We don’t know why sleep is so esential though.
All mammals sleep, but the only correlations between sleep and some other factor include that the larger the body size, the lower the sleep time, and the more immature the birth, the longer the amount of REM sleep. Besides these, there are no trends between sleep and, for example, phylogeny, phenotype or life history (see Lesku et al., 2006).
Despite this variability in mammalian sleep, the cetaceans (including whales) show some of the most unusual patterns, no doubt related to the environment they live in. Unlike every other mammals studied to date, cetaceans have no REM sleep (Mukhametov, 1995). In addition, unlike in other mammals, the slow waves that occur in sleep do not take up the whole brain but are instead restricted to one hemisphere at a time (Lyamin et al., 2004). In the bottlenose dolphin, each brain hemisphere gets 4 hours of slow wave sleep a day.
As a bonus, I’ll scratch the surface on the neurology of mammalian sleep – it’s one of those subjects that ‘spiritual’ people love to bring up as unexplainable by science, so it’s pleasurable to piss in their faces. Broadly, there are neuron clusters in two areas of the brain known to be involved in controlling sleep: in the basal forebrain and hypothalamus, and at the ponto-medullary junction in the brainstem. The one thing that will jump out immediately for those familiar with vertebrate brain development is that these nerve clusters are located in areas that develop from the embryonic basal plate. This leads to another interesting feature: the nerve clusters are restricted to the location of the original neuromeric segments. In other words, the two groups arise separately, they don’t have a single origin and then wander apart. This is of importance for comparative studies, as it allows us to draw reasonable homologies.
Mukhametov LM. 1995. Paradoxical sleep peculiarities in aquatic mammals. Sleep Research 24A, 202.
Lesku JA, Roth TC, Amlaner CJ, Lima SL. 2006. A phylogenetic analysis of sleep architecture in mammals: the integration of anatomy, physiology, and ecology. American Naturalist 168, 441–453.
Lyamin OI, Mukhametov LM, Siegel JM. 2004. Relationship between sleep and eye state in Cetaceans and Pinnipeds. Archives Italiennes de Biologie 142, 557–568.