system
Given the following post, respond as if you're commenting on Reddit:
human
Is it purely coincidence that the human sleep cycle roughly matches the day and night cycle of Earth or is it the time of day that determined our sleep habits?

For example, if days lasted 48 hours on Earth instead of 24 hours, would humans have adapted to stay awake for all the daylight hours and sleep for twice as long or do humans biologically need around 8 hours of sleep to function regardless of the amount of sunlight?
gpt
Nearly all life on earth (including fruit flies, plants, single-cell organisms, and even individual cells in the human body) has a circadian rhythm roughly 24 hours long, suggesting that this is a trait that evolved due to environmental influence. It's impossible to know how circadian rhythms would evolve on a planet with a different light-dark cycle, but there's no reason to expect life would do anything other than develop rest/activity cycles in line with the local light/dark cycle.

I can't think of any studies that experimentally manipulated the amount of sunlight to see whether sleep need varies, but observational studies have shown that people will sleep more during the winter and less during the summer. There are a lot of other possible explanations for that though.