Light exposure can cause our biological clock to advance or delay, which affects our sleep and wake cycle. Light is one of the most vital external factors that can impact sleep. Not only does it make it difficult for people to fall asleep, but it also influences our internal clock and therefore, modifying our preferred time to sleep.
Light manipulates our internal clock through "light sensitive" cells in the retina of our eyes. These cells, which occupy the same space as the rods and cones that make vision possible, tell the brain whether it is daytime or nighttime, and our sleep patterns are set accordingly. That is the reason that jet lag, television, day light savings, etc. play a role in our rest.
Links and resources:
https://healthysleep.med.harvard.edu/healthy/science/how/external-factors
https://www.helpguide.org/articles/sleep/getting-better-sleep.htm
https://www.physoc.org/magazine-articles/what-makes-a-good-nights-sleep/