It all depends on the circadian rhythm (Your 24 hour body clock).
This controls the sleeping and feeding patterns of animals, including human beings. This is connected to patterns in your core body temperature, brain wave activity, hormone production, cell growth and other biological activities. It is also linked to the length of day or night.
Hi candyangel99, Vicky’s covered all the main points below already! Animals like mammals get information about the amount of daylight through their eyes. This info gets sent to a tiny region of the brain that acts as a ‘master’ body clock – it figures out what time of day it is and communicates this to a brain region that releases hormones to signal to the rest of the body about time of day. This information from the hormones means that your brain and body’s organs function differently at different times of the day to affect the things that Vicky’s mentioned.
Although sleep is definitely linked to the body clock, there is also a separate mechanism that affects it. It is do with how tired an animal is and it works together with the body clock.