So I got scooped on the whole candle thing, which I really wanted to go with. Instead, I’m going to pivot and say that accurate timekeeping - day or night - was actually driven by the needs of navigation. 
You could get a pretty good idea of when it was based on the position of the sun and stars, as long as you knew where you were. The opposite is also true - you could figure out where you were, as long as you knew what time it was (and had the appropriate charts/data). The problem was that, while sailing around the world, ships often didn’t know either one.
For rough purposes, people used things like candles. In some cases, monks would recite specific prayers at a given cadence to keep track of time overnight and so know when to wake the others. These methods, as well as later inventions like the pendulum clock that used a known time component to drive watch mechanisms, were all but useless for navigation due to inaccuracies. They were good enough in the 1200s to let the monks know when to pray, though.