The scholars unanimously agree that fasting during menstruation is invalid, whether it is obligatory or voluntary, and that it is not permissible for menstruating women to fast.
This is based on the hadith of Abu Sa’eed al-Khudri in which the Prophet (Salla Allahu 'Alayhi Wa Sallam) said, "Is it not the case that when she menstruates she does not pray or fast?" They replied, "Yes." He said, "That is her shortcoming in religious commitment." (narrated by Muslim).
Therefore, if a woman begins menstruating at any time during the day, her fast is invalidated.
Furthermore, the scholars agree that she must make up missed obligatory fasts from Ramadan, as 'Aishah (Radi'Allahu Anha) stated regarding menstruation: “When we would have our menses during the lifetime of the Prophet (Salla Allahu 'Alayhi Wa Sallam), we were ordered to make up the days of fasting that we had missed but were not ordered to make up the prayers that we had missed.” (narrated by al-Bukhari).
If a woman gets her period while fasting, her fast is invalidated, even if the bleeding starts just before sunset. She must make up for that day if it was an obligatory fast. It is not allowed for her to continue fasting during menstruation.
Nifas after childbirth interacts with Ramadan the same way; see can you fast during nifas for what changes when postpartum bleeding is the cause rather than a period. Janabah is a different case again: unlike bleeding, Janabah present at Fajr does not invalidate the fast the way a period does. Istihadah is different again, since it is not classed as menstruation at all: see can you fast during istihadah for why irregular bleeding does not invalidate the fast the way a period does. Bleeding that shows up while taking a pill to delay a period for Ramadan is judged the same way spotting anywhere else is; see does spotting on a period delay pill break your fast for how to tell whether it is hayd or istihadah in that case.
The last ten nights of Ramadan often raise this alongside i'tikaf specifically, since a period occurring then affects two things at once, the fast and a stay in the mosque; see what if your period starts during i'tikaf for what it means for the mosque side of that. If the day in question finds you travelling rather than at home, see what if your period starts while you're travelling for how that separate concession interacts with the one for Ramadan.
Timing is exactly what a period tracker for Ramadan should help you get right, since it is the minutes before Maghrib, not just the day, that decide whether a fast counts.