Following the imaam until he finishes Taraaweeh
correct opinion is that the number of rakaahs for Taraaweeh is eleven, but I pray in a mosque where they do twenty one rakaahs. Can I leave the mosque after the tenth rakaah, or is it better to complete the twenty one rakaahs with them?
A: It is better to stay with the imaam until he finishes, even if he is doing more than eleven rakaahs, because it is permissible to do the extra rakaahs, as the Prophet (peace and blessings of Allaah be upon him) said: Whoever prays qiyaam with the imaam until he finishes, Allaah will record it as if he prayed the whole night
(reported by al-Nisaa'i and others. Sunan al-Nisaa'i, Baab Qiyaam Shahr Ramadaan), and because the Prophet (peace and blessings of Allaah be upon him) said: Prayer at night should be two by two (rakahs), and when dawn approaches, pray one for witr.(Reported by the seven; this version reported by al-Nisaa'i).
There is no doubt that adhering to the Sunnah of the Prophet (peace and blessings of Allaah be upon him) is better and brings more reward, so long as it is done properly and without haste, but if it is the matter of a choice between leaving the imaam because of the number of rakahs or going along with the extra that he does, it is better to go along with him, because of the ahaadeeth referred to above. At the same time, you should advise the imaam to follow the Sunnah.
Shaykh Muhammad Salih al-Munajjid: Al-Jummuah Magazine (Vol 10/Issue 8-9)
but there is also a hadith:
The actual Hadith which states that the Holy Prophet (Peace and blessings be upon him) performed 20 rak'ahs of taraweeh has been reported by Ibn Abbas (Allah be pleased with him). He said, "Verily, the Holy Prophet (Peace be upon him) in the month of Ramadaan, used to perform 20 rak'ahs and the witr prayer (afterwards) without congregation." (Reported in al-Sunan al-Bayhaqi, vol.2, pg. 496, Musannaf Ibn Abi Shaybah, Kabiri of Imam al-Tabarani, Ibn Aadi in his Musnad, and by Imam Baghawi in his Majmua-as-Sahabah )
He has said in his Fatawa Ibn Taymiyya (vol.1, pg. 191):
"It has been proven without doubt that Ubayy ibn Ka'b (Allah be pleased with him) used to lead the Companions, during Ramadan, for 20 rak'ahs and 3 rak'ahs of witr. Hence it is the principle (maslak) of most of the Ulama that this is the Sunnah, because Ubayy ibn Ka'b led 20 rak'ahs of prayer in the presence of the Muhajirin (the emigrants) and the Ansars (the helpers) and not a single Companion repudiated it!"