Apollo had an onboard guidance computer, with its own clock. From Wikipedia:
The AGC timing reference came from a 2.048 MHz crystal clock. The clock was divided by two to produce a four-phase 1.024 MHz clock which the AGC used to perform internal operations. The 1.024 MHz clock was also divided by two to produce a 512 kHz signal called the master frequency; this signal was used to synchronize external Apollo spacecraft systems.
The master frequency was further divided through a scaler, first by five using a ring counter to produce a 102.4 kHz signal. This was then divided by two through 17 successive stages called F1 (51.2 kHz) through F17 (0.78125 Hz). The F10 stage (100 Hz) was fed back into the AGC to increment the real-time clock and other involuntary counters using Pinc (discussed below). The F17 stage was used to intermittently run the AGC when it was operating in the standby mode.
Gemini likewise had an onboard guidance computer with a clock. According to the Wikipedia page on Gemini:
Gemini was the first astronaut-carrying spacecraft to include an onboard computer, the Gemini Guidance Computer, to facilitate management and control of mission maneuvers.
Which means that Mercury did not have a computer, and thus they probably had some sort of watch. The Mercury missions did not have any kind of maneuvering capability, except for reentry, so the need to keep time would be less pressing.
Edit: Reading through some of the specific Mercury missions, they make references to astronauts synchronizing clocks or timing things, so I must assume that they did have some clock, probably digital.