And Imam Ahmad said: “There is no fixed number for the night prayer of Ramadan. The Prophet ﷺ did not set any specific limit for it, so adding to the rakʿahs or reducing them depends on whether the standing is long or short.”
Shaykh Muḥammad ibn Ibrāhīm Āl al-Shaykh stated: “Most scholars—among them the imams Abū Ḥanīfah, al-Shāfiʿī, and Ahmad—hold that the Tarāwīḥ prayer is twenty rakʿahs. ʿUmar gathered the people behind Ubayy ibn Kaʿb, who led them in twenty rakʿahs, and this occurred in the presence of the Companions; it therefore amounted to a consensus, and the Muslims have followed it ever since.”
Ṭarḥ al-Tathrīb says: “The ḥadīth does not spell out how many rakʿahs the Prophet ﷺ prayed on those nights in the mosque. ʿĀʾishah said, ‘He never exceeded eleven rakʿahs in Ramadan or outside it.’ Yet when ʿUmar brought the people together for Tarāwīḥ in Ramadan, following Ubayy ibn Kaʿb, he led them in twenty rakʿahs, not counting three rakʿahs of witr. What took place in ʿUmar’s time was therefore treated as a consensus.”
Al-ʿAynī wrote: “The ḥadīths differ on the number of his rakʿahs: in the reports of Zayd ibn Khālid, Ibn ʿAbbās, Jābir, and Umm Salamah it is thirteen; in the reports of al-Faḍl, Ṣafwān ibn al-Muʿaṭṭal, Muʿāwiyah ibn al-Ḥakam, and Ibn ʿUmar it is eleven; in the report of Anas it is eight; in the report of Ḥudhayfah seven; in the report of Ayyūb four; and the greatest number is in the report of ʿAlī—sixteen rakʿahs.”
The answer is that each narrator reported what he himself witnessed: the Prophet sometimes increased, sometimes decreased, and he may have allowed the night prayer to be performed two or three separate times.
There are many additional explanations concerning what ʿĀʾishah (may Allah be pleased with her) related about the number of the Prophet’s ﷺ rakʿahs, but this is not the place to quote and elaborate on all of them.
What we say is what the majority of scholars have maintained: the night prayer, including Tarāwīḥ