Yes they do… sort of! How, when and where depend on the fish and what you define as sleep. First, fish lack eyelids so they don’t shut their eyes and doze off like we do. Second, what humans define as sleep involves a significant change in brain wave activity which doesn’t seem to occur in fish. But fish have periods of activity and inactivity and they appear to be recuperating during those inactive periods just like we do when we sleep.
Many fish seem to rest very lightly, sensitive to the slightest change in the water. Others are real dozers. I’ve actually held a slime-covered parrot fish during a night dive and that guy was out like a light! Some fish nest in cracks and holes in the reef or rocks. Others will sleep on the bottom. Any aquarist who owns a clown loach might relate their initial panic on finding the fish on its side, seemingly sick or dying. But once stirred by light or activity, the fish perks right back up. It was sleeping!
Some fish, including many species of shark, must keep moving to pass water over their gills to breath. It is suspected that these animals experience lowered or altered levels of brain activity that allow them to rest. It’s not unlike the autopilot experience you might be familiar with in which you’ve driven 20 or 30 miles on a major highway but weren’t really consciously aware of the act.