‘Aishah reported that the Prophet sallallahu alehi wasallam would not pray more than eleven rak’at during Ramadan or otherwise. This is related by the group.
Ibn Khuzaimah and Ibn Hibban have recorded in their sahihs on the authority of Jabir that the Prophet prayed eight rak’at and the witr prayer with the companions. Then, the next day, the people waited for him but he did not come out to them.
Abu Ya’la and at-Tabarani record, with a hasan chain, from Jabir that Ubayy ibn Ka’b came to the Prophet sallallahu alehi wasallam and said: “O Messenger of Allah, I have done something last night,” (i.e. during Ramadan). The Prophet said: ‘And what was that, O Ubayy?’ He said: The women in my house said, ‘We don’t recite Qur’an [well or much] so can we pray behind you?’ I prayed eight rak’at and the witr prayer with them.
The Messenger of Allah sallallahu alehi wasallam was pleased with that and did not say anything.”
This is the sunnah that has been related from the Messenger of Allah and nothing besides that is authentic. It is also true that during the time of ‘Umar, ‘Uthman, and ‘Ali the people prayed twenty rak’at, and this is the opinion of the majority of the jurists of the Hanafi and Hanbali schools as well as that of Dawud.
At-Tirmizhi says: “Most of the people of knowledge follow what has been related from ‘Umar and ‘Ali and other companions of the Prophet, [i.e., that they prayed] twenty rak’at. And this is the opinion of al-Thauri, Ibn al-Mubarak, and ash-Shaf’i. And so I found the people of Makkah praying twenty rak’at.”
Some of the scholars are of the opinion that the sunnah is eleven rak’at, including witr, and it is also preferred to pray the remainder [of the twenty rak’at].
Al-Kamal ibn al-Hamam says: “The evidence indicates that the sunnah of the twenty rak’at is what the Prophet sallallahu alehi wasallam himself did and then he stopped out of fear that it would become something obligatory (for his followers), therefore, the rest of the rak’at are only preferred. It is however, confirmed that he only prayed eleven rak’at, including the witr, as is stated in the two sahihs. According to the scholars, the sunnah is eight rak’at while it is preferred to pray twelve rak’at.”