The natural, endogenous period of circadian rhythms, as measured in constant conditions, is almost never exactly 24 hours. In the real world, however, the light-dark cycle provided by the Earth's rotation around its axis is exactly 24 hours long. Utility of biological clocks is in retaining a constant phase between environmental cycles and activities of the organism (so the organism always "does" stuff at the same, most appropriate time of day).
Thus, a mechanism must exist to synchronize the internal clock to the environmental cycle, in other words, to force the biological clock to assume a period of exactly 24 hours. The phenomenon of synchronization of biological rhythms by external cues is called entrainment.
It is important to keep in mind that the environmental cycle does not FORCE the oscillation of biological parameters (e.g,. sleep-wake cycle or body temperature). Instead, it synchronizes the clock which, in turn drives all the other biological phenomena. In other words, it does not turn over an hourglass clock every morning. If that was the case, failure to turn it over one morning would result in all the sand running out from top to bottom and the clock would stop. But we have seen that turning off the light does not stop the rhythms - they continue to freerun in constant conditions.
Entrainment is a process similar to re-setting a wrist-watch. If you have a watch that runs a little slow and accumulates about 5 minutes of delay every day, resetting it 5 minutes forward every morning will keep the watch reasonably well entrained.
Light-dark cycles are the most powerful environmental cues for entrainment, although many other cues have been demonstrated to be effective in entrainment of circadian rhythms in particular organisms, including cycles of temperature, atmospheric pressure, sound (e.g., conspecific song), feeding schedules, exercise schedules, odors, social cues, etc.
While details of physiological pathways that transduce environmental information to the clock may differ between varioius cues in various organisms, the essential ("formal") properties of entrainment are thought to be the same for all of them. Since light is the strongest synchronizer (Zeitgeber) and most of the studies were performed utilizing light as a cue, most of the discussion in the following series of posts will focus on entrainment by light.
There are two ways of thinking about entrainment by light. One, first suggested by Jurgen Asschoff, focuses on parametric properties of light, i.e., roles of intensity and spectral composition ("color spectrum") of light in entrainment. This is a difficult piece of theory to study and I will not spend too much time on it for now.
I will focus mainly on the non-parametric effects of light, i.e., the roles of timing of onset and offset of light on entrainment. Non-parametric analysis of entrainment by light, first thought of and used in elegant experiments by Patricia DeCoursey (in ground squirrels) and Woodie Hastings (in a protist Gonyolax polyedra) and subsequently developed by, for instance, Colin Pittendrigh (in Drosophila pseudoobscura) and Jeff Elliott (in hamsters), has been worked out in quite a lot of detail over the years, and is the cornerstone of the field of chronobiology. I will attempt to describe it and explain it as clearly and coherently as I can in a series of posts. This is not an easy concept to grasp, so take your time reading, and ask questions in the comments.