There are thirty tithis in a lunar month: fifteen in Shukla Paksha, the waxing half, and fifteen in Krishna Paksha, the waning half.
A tithi is not tied to midnight. It can begin or end at any clock time, which is why local sunrise and specific ritual moments matter for Panchang observances.