Praise be to Allah.
A woman may menstruate for eleven days or more, up to fifteen days, according to the majority of fuqaha’. Some of the scholars are of the view that there is no maximum limit for menses, but if a woman bleeds throughout the month or most of it, then she is regarded as mustahaadah (suffering from non-menstrual bleeding).
The end of menses may be known by one of two signs, the first of which is emission of the white discharge, which is known to women.
The second is complete dryness, meaning that if she inserts a piece of cotton and the like into the place, it comes out clean with no trace of blood or yellowish discharge on it.
The yellowish and brownish discharge that follow on from menses come under the same ruling as menses. If they come after there was certainty that the menses had ended, no attention is to be paid to them, because of the hadith of Umm ‘Atiyyah (may Allah be pleased with her), who said: We used to not regard the yellowish or brownish discharge after the end of menses as being of any significance. Narrated by Abu Dawood (307); classed as saheeh by al-Albaani in Saheeh Abi Dawood.
Based on that, we say:
1.. Regarding the cessation of bleeding on the fifth day, if what is meant by it is complete dryness, then in that case you must do ghusl, pray and fast, because you have become pure [your menses has ended]. If there is no complete dryness, then the menses is ongoing.
2.. If complete dryness does not occur during the seventh to eleventh days, then all of it is menses, and the yellowish discharge that occurs on the eleventh day is also regarded as menses, as noted above, because it did not come after the menses ended; rather it came immediately after that which comes under the ruling on menses.
But if complete dryness occurs during these days, even for a few hours, then this dryness is regarded as the end of menses, so the woman should do ghusl and pray as normal.
3.. With regard to the fast of the eleventh day, the ruling depends on what has been explained above. If this yellowish discharge occurred after the sign that the menses had ended, whether that was the white discharge or dryness, then it is not menses, so the fast of that day is valid. If it was not preceded by the sign of menses ending, then it is still menses, and the fast of that day is not valid, and must be made up.
And Allah knows best.