Measuring the passage of time and dividing it into units. Every method works by counting something that repeats regularly, and the history of the subject is a search for repetitions less affected by their surroundings.
A clock counts a repeating event. The accuracy of a clock is determined by how regular that event is and how well it can be isolated from disturbance.
Everything else follows from that. Improvements in timekeeping have come from finding more regular oscillators, not from better counting.

The earliest timekeeping used astronomical cycles, which are the most obvious regular repetitions available.
The day is one rotation of the Earth, the month approximately one lunar cycle, and the year one orbit. None divides evenly into the others, which is the origin of every calendar complication, as the religious festivals capsule describes.
Monuments aligned to solstices, including Stonehenge and Newgrange, indicate systematic observation of the solar year in prehistory.

Sundials divide the day by shadow, and are the earliest instruments for time within a day. They fail at night and in cloud, and the length of an hour defined this way varies with season, which ancient systems generally accepted rather than corrected.
Water clocks and hourglasses measure elapsed intervals rather than telling the time, and were used where a fixed duration mattered, including in courts, in ritual and at sea.
Mechanical clocks appear in Europe from around the late thirteenth century, driven by a falling weight and regulated by a verge and foliot escapement.
The escapement is the essential component: it releases the drive in discrete increments and is what turns continuous force into counted oscillations.
Early mechanical clocks were poor timekeepers, losing or gaining substantially each day, and their advantage was that they worked continuously and could strike the hours, which suited monastic and civic requirements. They generally had no minute hand, because they were not accurate enough for one to mean anything.
Christiaan Huygens applied the pendulum in 1656, using Galileo's observation that a pendulum's period depends on its length rather than on the size of its swing. Accuracy improved by roughly two orders of magnitude within a few years, and the minute hand became worth fitting.
The pendulum cannot be used at sea, which is why the longitude problem required a different solution, as the navigation capsule describes.

Precision pendulum clocks reached remarkable accuracy by the early twentieth century, kept in vacuum chambers at constant temperature, and were used as astronomical time standards.
Quartz crystals vibrate at a frequency determined by their cut and size, and the effect is stable and cheap to exploit. Quartz clocks appeared in the 1920s and quartz wristwatches from 1969, and they made accurate timekeeping ordinary rather than expensive.
Atomic clocks count transitions between energy levels in atoms. The frequency is set by physics rather than by the manufacture of an object, so two atomic clocks of the same design agree without adjustment.
The second is now defined by a specified number of cycles of a caesium-133 transition, as the units of measurement capsule describes, and the best current optical clocks would not gain or lose a second over a period far exceeding the age of the universe.
That accuracy is not a curiosity. Satellite navigation depends on it directly, since position is derived from differences in signal arrival time, and an error of a nanosecond corresponds to about thirty centimetres.
Relativistic corrections are required at that precision. Clocks run at different rates depending on speed and gravitational potential, and satellite navigation systems apply corrections for both effects continuously, which is among the most routine practical uses of relativity.
Local solar time differs continuously with longitude, so before rapid travel every town kept its own time and the difference did not matter.
Railways made it matter, as the railways capsule describes, and standard time zones were adopted internationally in 1884.
Coordinated Universal Time is maintained from atomic clocks, and leap seconds have been inserted periodically to keep it aligned with the Earth's rotation, which is gradually slowing and irregular. The practice causes difficulties for computer systems, and a decision has been taken to discontinue leap seconds by 2035.
Timekeeping determined what could be coordinated. Scheduled transport, financial settlement, industrial shifts and scientific measurement all require agreement on when, and the precision available has repeatedly set a limit on what could be organised.
It is also the measurement humans have pushed furthest. Time is the most precisely measured physical quantity by a wide margin, which is why other units, including the metre, are now defined in terms of it rather than the reverse.