Despite having eyelids, these creatures do not actually close their eyes - not even whilst they lie still (if they are a species that is able to be motionless) nor while having a rest period in terms of limited brain or cerebral activity.
The upper and lower eyelids on these fish do not close all the way across the eyes. So they are unable to blink as humans can. Our blink functionality is there so that our eyes are kept clean and moist. With sharks, their eyes are kept clean due to the fact that they are swimming through water.
Some species have a 3rd eyelid, for want of a better term, which covers over each eye. This is called a nictitating membrane.
The membrane seems to function as protection for the eyes when hunting or during an attack where the eyes may get scratched. So the membranes act as protective shields in these instances.
Other species, such as the Great White and Whale Shark, have no membrane but are able to roll their eyes back into the protection of the eye socket instead. This makes them look even more fierce because you can no longer see their pupil or iris, just the white of their eye. Eyelids vary from species to species. The one thing that is clear is that if sharks do actually go to sleep, they don't close their eyes to do so.