In Surah Ahzab chapter 33 verse 52:
"It is not lawful for thee (to marry more) women after this, nor to change them for (other) wives, even though their beauty attract thee, except any thy right hand should possess (as hand maidens) and Allah doth watch over all things ". [Al-Qur’an 33:52]
This verse clearly gives Prophet Muhammad (pbuh) the permission to keep all his previous wives but prohibits him to marry any more women except those which his right hand possessed i.e. slave girls.
The Prophet (pbuh) was allowed to keep all his previous wives because no one was allowed to marry the Prophet’s wives (ra) after they were divorced or widowed as they were ummul-momineen (mother of the believers)
People falsely accuse the Prophet (pbuh) of being hypersexual, because he had eleven wives. If you read the life history of the Prophet (pbuh), only two of his marriages one with Khadija (ra), and the other, with Ayesha (ra) were marriages in the normal course. All his other marriages were contracted as a necessity and were based on various considerations.