You are right: at the time of Ptolemy they could not measure
the length of a day directly. Actually Ptolemy never discusses any clocks in his book, he probably used some crude devices
record the approximate times of observations, which he never gives with accuracy better than 1/4 of an hour.
The main reason for the equation of time is that
ecliptic is inclined to the equator. So the hour angle of the Sun (the angle measured along the equator) is not a linear function of Sun's latitude (position on the ecliptic). In addition to this, Sun moves on the ecliptic not uniformly.
The primary observation for this phenomenon is that the seasons have unequal length (measured in days). This was known long before Ptolemy. This implies that the Sun moves on
the ecliptic with varying speed. The speed depends on its position on the ecliptic. The equation of time reflects the difference between the actual speed on a given day and
the average speed over the year. Ptolemy introduces an imaginary object, the "mean Sun", which moves on the ecliptic with constant speed (=the average speed of the Sun), and uses
it as a reference for the time of all other astronomical phenomena.
To be specific, all solar theory of Ptolemy is derived from 15 observations of solstices and equinoxes which are recorded with accuracy of 1 hour, and spread over 570 years.
So for example, the length of the year can be obtained as the number of hours between the first and last observation, divided by 570. If the error
of the observations is $E$, then the error in the length of the year is $E/570$. This shows the principle, how great precision is achieved.
Remarks. 1.This brings a more general question: what is time, really?
Which time intervals are equal, and how do we know (or decide) this?
Nowadays we use all kinds of clocks, but this was not the case before accurate clocks were invented.
To define time scale one has to choose some periodic (repetitive) natural process and postulate that it
happens "at the constant speed".
At the time of Ptolemy, there were essentially two choices: a) to assume that the diurnal rotation of the sky
is uniform (that is to choose a day as the basic unit), or
b) to assume that Sun moves at a constant speed on the ecliptic
(that is to choose the year as the basic unit). Equation of time shows that these two choices are somewhat inconsistent.
Once this is discovered, the choice is dictated by simplicity of the mathematical model. In Ptolemy's own words:
And in general, we consider it a good principle
to explain the phenomena by the simplest hypotheses possible, in so far as there
is nothing in the observations to provide a significant objection to such a
procedure.
(Chap. III, section 1, 201 of Toomer's translation).
Ptolemy chooses b), that is the motion of the "mean Sun"
as the standard for time measurement.
The result is that days are of unequal length.
(There was actually a third possibility: to choose the diurnal rotation of the sky (="fixed" stars) for the time scale. It was actually a great insight of Hipparchus
that Sun gives the "correct" choice of the time scale).
A good general philosophical discussion of the meaning of time is an article of Poincare Time measurement in his book The value of science.
At the time of Poincare, time was defined as "the variable which makes the Second Law of Newton true".
Nowadays we use a more fundamental physical theory
(quantum mechanics) to define time scale.
- Almagest is a difficult reading for a modern reader. There are two excellent modern expositions in English: O. Neugebauer, A history of ancient mathematical astronomy, and O. Pedersen, A survey of Almagest.