Whether fish sleep or not is an open question, to the point of having inspired the title of several popular science books.  In birds and mammals, sleep is defined by eye closure and the presence of typical patterns of electrical activity in the brain, including the neocortex, but fish lack eyelids and a neocortex.  Some species that always live in shoals or that swim continuously (because of a need for ram ventilation of the gills, for example) are suspected never to sleep. There is also doubt about certain blind species that live in caves.

However, other fish do seem to sleep, especially when purely behavioral criteria are used to define sleep. For example, zebrafish, tilapia, tench, brown bullhead, and swell shark become motionless and unresponsive at night (or by day, in the case of the swell shark); Spanish hogfish and blue-headed wrasse can even be lifted by hand all the way to the surface without evoking a response. On the other hand, sleep patterns are easily disrupted and may even disappear during periods of migration, spawning, and parental care.

Behavioural sleep 
Instead of examining brain activity for sleep patterns, an alternate approach is to examine any rest/activity cycles that might indicate "behavioural sleep". The following four behavioural criteria are characteristic of sleep in birds and mammals and could be extended to fishes:  (1) prolonged inactivity; (2) typical resting posture, often in a typical shelter; (3) alternation with activity in a 24-h cycle; (4) high arousal thresholds. Based on these criteria, many fish species have been observed sleeping.  The typical sleep posture of the brown bullhead is with the fins stretched out, the tail lying flat on the bottom, the body inclined to one side at an angle of 10-30 degrees to the vertical, the cardiac and respiratory frequencies much slower than normal, and much less sensitivity to sound and to being touched.  Mozambique tilapia are motionless at the bottom at night, with a lower respiratory rate and no eye movement, and they do not respond as readily as during the day to electrical currents or food delivery. At night, Spanish hogfish,  bluehead wrasse, the wrasse Halichoeres bivittatus, the cunner Tautogolabrus adspersus, and even requiem sharks, can be picked up by hand without eliciting a response. A 1961 observational study of approximately 200 species in European public aquaria reported many cases of apparent sleep.

Divers can easily see fishes settling down for the night in typical shelters, such as holes and crevices, underneath ledges, amidst vegetation, inside sponges, or buried in sand.  Some extra protection can be derived from special secretions, such as the mucous envelope produced by several species of wrasse and parrotfish, either around the fish themselves or at the opening of their shelter. These envelopes screen the sleeping fish from predators  and ectoparasites.

In the laboratory, periods of inactivity often alternate with periods of activity on a 24-h basis, or a near 24-h basis when the lighting conditions are constant. Circadian rhythms of activity have been documented in over 40 different fish species, including hagfish, lamprey, sharks, cyprinids, ictalurids, gymnotids, salmonids, and labrids.

Physiological sleep 
One physiological characteristic of sleep goes by the name of "homeostatic regulation". This is the notion that animals need a more or less constant amount of sleep every day, so that if a subject is deprived of sleep one day, the amount of sleep tends to "rebound" (increase) the next few days. This has been observed in zebrafish. At night, zebrafish appear to float in the water column, either horizontally or with the head slightly up. The frequency of mouth and gill movement is reduced by almost half and they are twice as hard to arouse as during the day. If they are deprived of this sleep-like behaviour, the sleep bouts thereafter are longer and the arousal threshold is higher than usual, suggesting a rebound effect.  Similarly, in the convict cichlid, activity decreases on days that follow an experimental disruption of the fish's normal rest behaviour at night.

Absence of sleep 

Many pelagic fish species, such as bluefish, Atlantic mackerel, tuna, bonito, and some sharks, swim continuously and do not show signs, behavioural or otherwise, of sleep.  It has been argued that one function of sleep is to allow the brain to consolidate into memory the things it has learned during the animal's normal period of activity. The brain might not be able to do this while still assailed by new stimuli and new information to process. Therefore, the role of sleep would be to periodically shut down sensory input to allow the brain to form memories. Pelagic species swim in an environment that is rather boring (kilometers upon kilometers of open water with not much happening in it). In such species, the sensory input is so low that memory formation could take place even if the fish keeps on moving (a repetitive activity) and does not fall asleep in the traditional sense of the word.

Diurnal damselfish normally sleep motionless in crevices within coral reefs at night, but three species (the green chromis, the marginate dascyllus and the whitetail dascyllus) spend the night between coral branches where they beat their fins at a rate about twice that of normal daytime swimming. This creates water currents that keep the inner zone of the coral (and thus the fish themselves) well oxygenated, at levels about four times higher than in the absence of the fish. Though the fish are active (mostly in a repetitive way), they do not respond to light or to the presence of potential predators. The researchers who documented this behaviour called it "sleep-swimming".

Sleep could also be absent during specific parts of a fish's life. Species normally quiescent at night become active day and night during the spawning season.  Many parental species forego sleep at night and fan their eggs day and night for many days in a row. This has been observed in threespine stickleback,  convict cichlid and rainbow cichlid,  various species of damselfish,  smallmouth bass and largemouth bass, and the brown bullhead. Some diurnal species, like the tautog Tautoga onitis, become active day and night during migration. In the Mozambique tilapia, sleep has been observed in adults, but not in juveniles.

Some species may be variable in the phasing of their daily activity/inactivity periods, and thus presumably of their sleep. Within the same laboratory populations of goldfish, some individuals may be spontaneously diurnal while others are nocturnal. Goldfish can also be diurnal if food is more available by day, or nocturnal if food is available at night. Salmon are mostly diurnal when temperature is high, but become more nocturnal if temperature plummets. At high latitudes, captive burbot, sculpin and brown bullhead are nocturnal in summer but become diurnal under the short photoperiod of the Arctic winter. In captivity, white sucker Catostomus commersonii are diurnal when living in a shoal but nocturnal when living alone.

References 

Sleep
Ichthyology
Sleep physiology