When light enters the eye, it is transmitted into the retina and turned into neural impulses that travel to the hypothalamus and to the suprachiasmatic nucleus (SCN). While the hypothalamus is the part of our brain that is responsible for a variety of core functions, the SCN is the master clock.
The SCN communicates with a variety of other neural centers that are responsible for sleep and wakefulness. The amount of light the SCN registers is what determines whether we are more or less likely to be awake or asleep, working through these other neural centers and a variety of other neural transmitters, including serotonin, acetylcholine, dopamine, and orexin.
Another important influence on the circadian rhythm - and directly related to light exposure - is melatonin.
This hormone is commonly released in darkness, roughly 4-5 hours before we go to sleep, and suppressed by light, allowing us to both fall asleep and wake up. This effect is one of the reasons why it can be helpful in some people, both in shifting the circadian rhythms and in helping with sleep.
But to reiterate, the most important influence on our circadian rhythm is light; when you get light and how much light you get will be important in setting your circadian rhythm and therefore, influencing your ability to fall and stay asleep.