Praise be to Allah.
Firstly: if the period comes after the time for a prayer has begun, when enough time has elapsed to pray one rak’ah, then you have to make it up when you become pure (i.e., when the period ends). Shaykh Muhammad ibn Saalih al-‘Uthaymeen (may Allaah have mercy on him) was asked about a woman who got her menses when enough time to pray one rak’ah had passed: does she have to make up that prayer?
He replied: If a woman’s menses comes after the time for prayer begins, then when she becomes pure she must make up that prayer during the time of which her menses came, if she did not pray before her menses began. That is because the Prophet (peace and blessings of Allaah be upon him) said: “The one who catches up with one rak’ah of the prayer has caught up with the prayer.” If enough time to pray one rak’ah elapses then the woman’s menses begins before she prays, then when she becomes pure she has to make it up. End quote.
The time for making up the prayer is as soon as the excuse no longer applies. So when you become pure following menses, you must do ghusl and offer the prayer that was due, even if it is not the time for that prayer, and you should not wait until its time on the following day, because the Prophet (peace and blessings of Allaah be upon him) said: “If a person forgets a prayer, let him offer it as soon as he remembers; there is no expiation for it other than that.” Narrated by al-Bukhaari (597) and Muslim (684).
If a woman becomes pure before the time for prayer ends, then she must offer that prayer and the one that may be joined to it, according to the majority of scholars.
For example: if a woman becomes pure before the sun sets, she must offer Zuhr and Asr together. It says in Fataawa al-Lajnah al-Daa’imah (6/161): If a woman becomes pure from menses or nifaas before the time for an obligatory prayer ends, she must offer that prayer and the one that may be joined to it before it. If she becomes pure before the sun sets she must pray ‘Asr and Zuhr. If she becomes pure before the second dawn breaks, she must pray ‘Isha’ and Maghrib. If she becomes pure before the sun rises she must pray Fajr. End quote.
We have discussed the difference of opinion among the scholars concerning this in question no. 82106.
And Allaah knows best.