Short answer
Allah gave the Prophet ﷺ a special permission in Surah al-Ahzab that applies only to him, while other Muslims may have up to four wives. Then Allah forbade him from marrying any more. Most of his marriages came late in life and had clear social and religious reasons.
Sunni scholars agree that marrying more than four was a special rule (khususiyya) for the Prophet ﷺ alone, given in 33:50, and that 33:52 then barred him from new marriages. For everyone else the limit is four, with justice between wives.
The four schools agree on this.
Explanation
Surah al-Nisa sets the limit for believers at four wives, and only if a man can be just. Surah al-Ahzab then addresses the Prophet ﷺ and names the women made lawful to him, describing this as for him "exclusively, not for the believers". Scholars list it among the things special to him, like the fact that his wives could not remarry after him.
His married life also needs to be seen in full. From the age of about 25 until about 50 he had one wife, Khadijah, and did not marry anyone else while she lived. Almost all of his other marriages came in the last ten or so years of his life, in Madinah, while he was leading a young community through war and hardship.
Scholars point to the wisdom in these marriages. Several of his wives were widows, such as Sawda, Hafsa and Umm Salama; the husbands of Hafsa and Umm Salama had died of wounds received fighting for Islam. Some marriages joined him to tribes and allies, such as Juwayriya, whose marriage led to the release of her people, and Umm Habiba, daughter of Abu Sufyan. Marrying Zaynab bint Jahsh ended a pre-Islamic custom about adopted sons. And his wives carried his private Sunnah to the ummah.
Later Allah forbade him to marry again or exchange any wife (33:52). For a full list, see Wives of the Prophet ﷺ. For the ruling for other Muslims, see What are the conditions to marry a second wife?
The evidence
Quran, Surah An-Nisaa 4:3
وَإِنْ خِفْتُمْ أَلَّا تُقْسِطُوا۟ فِى ٱلْيَتَٰمَىٰ فَٱنكِحُوا۟ مَا طَابَ لَكُم مِّنَ ٱلنِّسَآءِ مَثْنَىٰ وَثُلَٰثَ وَرُبَٰعَ ۖ فَإِنْ خِفْتُمْ أَلَّا تَعْدِلُوا۟ فَوَٰحِدَةً أَوْ مَا مَلَكَتْ أَيْمَٰنُكُمْ ۚ ذَٰلِكَ أَدْنَىٰٓ أَلَّا تَعُولُوا۟ ﴿٣﴾
And if you fear that you will not deal justly with the orphan girls, then marry those that please you of [other] women, two or three or four. But if you fear that you will not be just, then [marry only] one or those your right hand possesses. That is more suitable that you may not incline [to injustice].
The limit of four for believers, with justice.
Quran, Surah Al-Ahzaab 33:50
يَٰٓأَيُّهَا ٱلنَّبِىُّ إِنَّآ أَحْلَلْنَا لَكَ أَزْوَٰجَكَ ٱلَّٰتِىٓ ءَاتَيْتَ أُجُورَهُنَّ وَمَا مَلَكَتْ يَمِينُكَ مِمَّآ أَفَآءَ ٱللَّهُ عَلَيْكَ وَبَنَاتِ عَمِّكَ وَبَنَاتِ عَمَّٰتِكَ وَبَنَاتِ خَالِكَ وَبَنَاتِ خَٰلَٰتِكَ ٱلَّٰتِى هَاجَرْنَ مَعَكَ وَٱمْرَأَةًۭ مُّؤْمِنَةً إِن وَهَبَتْ نَفْسَهَا لِلنَّبِىِّ إِنْ أَرَادَ ٱلنَّبِىُّ أَن يَسْتَنكِحَهَا خَالِصَةًۭ لَّكَ مِن دُونِ ٱلْمُؤْمِنِينَ ۗ قَدْ عَلِمْنَا مَا فَرَضْنَا عَلَيْهِمْ فِىٓ أَزْوَٰجِهِمْ وَمَا مَلَكَتْ أَيْمَٰنُهُمْ لِكَيْلَا يَكُونَ عَلَيْكَ حَرَجٌۭ ۗ وَكَانَ ٱللَّهُ غَفُورًۭا رَّحِيمًۭا ﴿٥٠﴾
O Prophet, indeed We have made lawful to you your wives to whom you have given their due compensation and those your right hand possesses from what Allah has returned to you [of captives] and the daughters of your paternal uncles and the daughters of your paternal aunts and the daughters of your maternal uncles and the daughters of your maternal aunts who emigrated with you and a believing woman if she gives herself to the Prophet [and] if the Prophet wishes to marry her, [this is] only for you, excluding the [other] believers. We certainly know what We have made obligatory upon them concerning their wives and those their right hands possess, [but this is for you] in order that there will be upon you no discomfort. And ever is Allah Forgiving and Merciful.
The special permission given to the Prophet.
Quran, Surah Al-Ahzaab 33:52
لَّا يَحِلُّ لَكَ ٱلنِّسَآءُ مِنۢ بَعْدُ وَلَآ أَن تَبَدَّلَ بِهِنَّ مِنْ أَزْوَٰجٍۢ وَلَوْ أَعْجَبَكَ حُسْنُهُنَّ إِلَّا مَا مَلَكَتْ يَمِينُكَ ۗ وَكَانَ ٱللَّهُ عَلَىٰ كُلِّ شَىْءٍۢ رَّقِيبًۭا ﴿٥٢﴾
Not lawful to you, [O Muhammad], are [any additional] women after [this], nor [is it] for you to exchange them for [other] wives, even if their beauty were to please you, except what your right hand possesses. And ever is Allah, over all things, an Observer.
He was then barred from any further marriage.
Sahih Muslim 2436
Sahih... لم يتزوج النبي صلى الله عليه وسلم على خديجة حتى ماتت ...
"The Prophet did not marry anyone else alongside Khadijah until she died."
His long years of marriage to one wife.
Where the ruling is recorded
- Zad al-Ma'ad (Ibn al-Qayyim), Section on his wives. Lists his wives and the circumstances of each marriage.
- Fath al-Bari (Ibn Hajar), Commentary on Kitab al-Nikah, chapter on how many wives a man may marry. Explains that more than four was special to him.
- al-Hidaya (al-Marghinani), Kitab al-Nikah, chapter on women who are forbidden. The Hanafi limit of four wives for a free man.
This answer is pending review by the scholars on our team. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.