Most animals (most life in fact) have circadian rhythms - the ability to measure time over a 24 hour period. This helps them to anticipate when to engage in behaviors such as sleeping, searching for food, etc., and to adjust their bodies' physiologies for those behaviors. In animals (at least vertebrates), the molecular basis of the clock is fairly well understood and involves a constant buildup of a specific protein over the course of the day, more protein equals more time, the protein level gets "reset" to zero each morning or evening to restart the timer.
Even single celled plankton do this!