It's a Complex Clock
The body clock isn't some rinky-dink Mickey Mouse watch. In fact, it's a series of clocks controlled by a single "master clock" located in the brain. The system works like this: Genes within the body include instructions for making proteins, which are produced in waves that rise and fall over the course of a day in a type of 24-hour cycle [sources: NIGMS, EarthSky].
The master clock manages these circadian rhythms using a group of roughly 20,000 nerve cells called the suprachiasmatic nuclei (SCN), located in the hypothalamus. This section of the brain sits above the optic nerve and produces the hormones that govern body temperature, hunger, sex drive and other workings of the body. The patterns created not only dictate when we eat and sleep, but also control heart rate and the production of blood cells and blood sugar. Although the genes and proteins generally determine individual rhythms, outside factors related to light and dark can also have a significant impact on how your body "tells time" [sources: NIGMS, Healthline, University of Utah].