What is the ruling if a woman’s period lasts longer than
15 days?

If blood continues to flow and a woman is still waiting to purify
herself, and it exceeds 15 days, then she should fall back to her
normal period as a reference. Accordingly, she must make ghusl, and
start praying, and in addition make up the prayers for the days which
she did not pray since the time when her normal period would have
ended.

For example, suppose a woman has a normal period of 6 days.
However, during a given month blood continued to flow until 15
days had passed, while she is still waiting for the end of the period.
In this case she makes ghusl immediately, and starts praying, and
prays all the prayers for the 9 days counted from the end of her
normal period until she made ghusl.

The reason for this is that the longest that a woman’s menstrual cycle
can be is 15 days according to madhab Imam Ahmed and many
scholars (al-Mughni 1:388). Thus, if the flow continues past 15 days,
then everything after the number of days in a normal cycle is
considered istihada (which is blood that flows from a woman due to
reasons other than menstruation, such as from a burst vein,
hemorrhage, etc.)

 Regarding making up the missed prayers, she should pray them
consecutively in order by intention, in one session, and she can rest if
she gets tired.