The word "time" actually refers to two different abstract concepts. One is the length or duration of some event, such as "That movie was over three hours long." The other is the period in time, as in "That movie opened Friday." The date is a point within a larger set of cycles; The period is a select number of cycles.
Time keeping, then, is a matter of keeping track of the number of cycles that have passed. The date and the period both use a cyclic interval of some sort: a month, a hour, a minute, a second.
For both, the basic unit of time may be the second. From the second, the minute, the hour and the day are formed. In increments less than a second, time is counted in increments of 10. A millisecond is 1/1,000 of a second, a microsecond is 1/1,000,000 of a second, and so on.
So it follows that measuring time requires something that resonates at predicable rate.
All clocks have three common elements. All of them need some sort of device to produce a periodic phenomenon, sometimes called a resonator. They need a power source. And they need some way of measuring the oscillations.
Electric clocks use the frequency of the power source to keep time, 60 megahertz in the US. In an atomic clock, time-keeping is based on the regular signals emitted by electrons when they change energy levels. A cesium atom, for instance, swings at 9 billion hertz.
A resonator must have both good stability and good accuracy. In other words, it oscillator must give the same result over an extended of time and that result must be the desired value. The resonator must not drift from its oscillation rate as it loses energy.
The sun, perhaps the first time-keeping device, has a frequency of once a day. The day is defined by the daily orbit of the earth around the sun. A month is defined by the a complete revolution of the moon.
Perhaps the first time keepers only needed to keep track of when noon occurred. They did this by planting a stick in the ground, observing when the shadow it cast was the shortest. The shortest shadow of the day signifies when the sun is at its apex of its daily trek across the sky, in relation to that location.
As a time keeping instrument, the sun is remarkable reliable. It is predictable. It is universally available. It is stable. From these qualities, man could use a sun-based calendar to anticipate and schedule events in the future.
As man started requiring time measurements of higher resolution, however, the sun started showing some limitations. It suffers from all sorts of minor variances. The earth rotates around the sun not in a circle, but in an ellipse. This means the earth travels faster through space when it is closet to the sun. Also, the earth wobbles, and there is variance in the speed of its rotation.
Over time, mankind has shifted away from using the sun it as a time measurement device, and instead, relies on the time measurement system we created from the sun's daily cycles. Now people look at the clock to what time the sun rises, whereas once, we looked at the sun to see what time it was.
The first mechanical clock was probably built sometime in the 14th century. Early clocks rarely kept the same time. Galileo was the first to think of using a pendulum. The pendulum could serve as a universal frequency determine device. The nice thing about the pendulum is that its cycle can be set by the length of the string. The size of the weight of the bottom did not matter (to to the degree that it would affect time keeping anyway). Nor did its location on the planet. (Galileo never actually got around to building a clock, btw). The pendulum is not perfect either, however. Changes in temperature can subtly alter the length of the string. Air drag, which is different at different altitudes also skews accuracy.
From this solar time, other derivations of time-keeping have popped up as well, some voluntary, some inherit. Based on the sun's daily cycle, our bodies developed their own built in, or biological time, called the circadian rhythm. Circadian rhythms are regulated by the suprachiasmatic nucleus (SCN), a small organ in the hypothalamus.
On the other end of the spectrum, Geologic time measures major shifts in the earth's 4.5 billion year history, using the millennium as the basic increment.
Keep in mind that the universe might end in as little as 5 billion years. That is when our own sun will die out, at any rate. And if the universe does implode, time, in all its many cycles, will die with it.
Notes taken from the NIST paper, From Sundials to Atomic Clocks.