All praise is due to Allah, and peace and blessings be upon our Prophet Muhammad.
The minimum duration of menstruation is one day and one night, and its maximum is fifteen days. Any blood beyond this period is considered irregular bleeding (Istihada). Since the bleeding did not exceed fifteen days, it is considered menstrual blood within the regular cycle. Therefore, you should not pray or fast until the bleeding stops and the signs of purity appear. If the bleeding stops before fifteen days from when it first started, then all the blood you saw is considered menstrual blood, and you must make up the fasts, but not the prayers. If it exceeds fifteen days, then the first six days are menstrual blood, and the blood that follows is considered irregular bleeding. Your prayers and fasting are valid, and there is no issue with them. And Allah Knows Best."
*This answer was updated on [18/5/2023].