Final answer:
The pineal gland is responsible for the production and release of melatonin, which regulates the sleep-wake cycle and is influenced by the light-dark cycle.
Step-by-step explanation:
The gland that produces and releases melatonin is the pineal gland. This tiny endocrine gland, situated near the center of the brain and posterior to the thalamus, regulates the sleep-wake cycle through the secretion of melatonin. The photoperiod highly influences the rate of melatonin production; it rises during the night when it is dark and diminishes during the day. This hormone is also an antioxidant that protects the central nervous system from free radicals and plays a role in biological rhythms such as circadian rhythms, influencing sleep patterns and eating habits.