The first humans almost certainly followed a pattern of being active during daylight and resting or sleeping during the night, if the latter with one eye open, because of potential danger. As humanity developed it also began to develop the potential for tracking time. During the day following the path of the sun is the first step and this eventually leads to the use of shadows to track and to express times. However at night the sun is no longer visible and it is rare for the moon to be bright enough cast shadows and these are fairly useless for tracking time. So how do you track time at night?
If you look into a clear night sky the heavens are full of stars, still visible in the days before the invention of street lighting and light pollution. At first there seems to be no order to this extensive panorama of bight points but for those living in the northern hemisphere if you look due north you will eventually perceive that there is one star, Polaris the North or Pole Star, that appears to remain stationary whilst the stars and groups of stars surrounding it appear to circle it as the night proceeds. As we know, the stars are stationary it is the earth that is revolving on its axis. The stars and groups of stars closest to Polaris appear to circle it completely but those further away rise up over the horizon cross the sky and then set under the horizon on the other side of the heavens.
The ancient Egyptians used this phenomenon of the rising stars and groups of stars, (
known as heliacal rising wrong see comments!) to tell the time at night. They identified thirty-six stars or groups of stars, known as the Decans (because a new one appeared over the horizon every ten days), for this purpose to cover the whole year, because of the tilt of the earth’s axis different stars or groups of stars rise on different nights. On any given night twelve of these chosen stars or groups of stars rose over the horizon at regular interval during the night giving the Egyptian astronomer/priests a clock with which to divide the night into twelve periods. Again, because of the tilt of the earth’s axis and the varying seasons the length of the nights varies and with them the length of the divisions. With time the Egyptians also divided the daytime into twelve segments giving us our twenty-four hour day.
Later cultures measured the hours of the night using other methods such as water clocks (or clepsydra) and candle clocks. These of course because of their imperfections only give approximate hourly divisions but this was more than accurate enough for those using them, who did not yet possess our obsession of living by the clock.
However others, like the ancient Egyptians, continued to use star clocks. Mariners who regularly sailed the same routes grew to know the night sky and could by observing the position of a given circumpolar star or group of stars approximately determine the hours of the night. This form of using the circumpolar stars as the hands of a clock was put into use in the Middle Ages by the invention of an astronomical instrument known as a nocturnal or nocturlabium.
The nocturnal is a circular, usually brass, instrument with a hole in the middle. It has two discs or dials and an indicator arm or pointer that sticks out beyond the outer dial. The outer dial is marked with the months of the year and the inner dial with the hours of the day. The inner dial also has a pointer. Nocturnals are constructed and calibrated for a specific circumpolar star. To tell the time the inner disc is rotated until its pointer points at the right month. Then the instrument is raised to the observer’s eye and the Pole Star is sighted through the central hole. The pointer or indicator arm is then adjusted until it lies on the position of the calibrated star or star group. The time can now be read off on the inner dial. Small nocturnals are usually only calibrated in hours, larger instruments are accurate to a quarter of an hour.
 Because the stars are actually moving very slowly relative to the earth the star that has been perceived as the Pole Star over the millennia has actually changed.