The pineal gland is responsible for controlling the production of the hormone melatonin, which helps to regulate sleep. Melatonin production increases when there is less light present, making humans sleepy. The pineal gland includes light sensitive cells, which are activated through the retina of the eye. These cells can sense how much light is present, and signal the gland to make more or less melatonin.
in addition to previous answer (which is entirely correct); the pineal gland also impacts the onset of puberty. The actual mechanism is not yet understood--we simply know pineal gland function / dysfunction can be linked to early and / or delayed start of puberty.