Why do you close your eyes? Is it to change settings?

Closing your eyes shuts off visual stimuli, or so I've heard. Probably why you wake up.