How tithi is calculated
A tithi ends each time the Moon's elongation from the Sun crosses a multiple of 12 degrees. Thirty of them make a lunar month.
Take the Moon's longitude, subtract the Sun's, and you have the elongation. It runs from 0 degrees at the new moon to 360 by the next one. Cut that into thirty steps of 12 degrees each and every step is a tithi.
The steps are not equal in time. The Moon's speed varies, so a tithi can run anywhere from about 19 to about 26 hours. That variation is the whole reason ending times have to be printed at all.
Which tithi names the day
The one running at sunrise. A tithi that begins at 10 pm and ends at 8 pm the next evening was running at that morning's sunrise, so it names that day — even though it covered most of two.
The consequence is that a tithi can be skipped entirely. If one begins after sunrise and ends before the next, no sunrise falls inside it and no day carries its name. Almanacs mark these as kshaya tithis.
One thing tithi does not depend on
The ayanamsha. Elongation is a difference between two longitudes, so whatever constant you subtract to convert tropical to sidereal cancels out. Two almanacs using different ayanamshas will still agree on the tithi.
They can still disagree on its ending time, but that is a difference of basis — vakya against drik — and not of ayanamsha.
Reading it against a printed almanac
Ending times are where a printed almanac and a computed one part company first, and the usual reason is basis rather than error — a vakya almanac such as the Pambu works from mean-motion tables, and its endings can sit hours away from observational ones. That difference has its own page.