The issue of 8 or 20 Rakat tarawih in the month of Ramadhan,
Sahih Hadith discouraging leaving the taraweeh before the imam is finished
During taraweeh prayers, some people walk out after the imam has completed only eight rakats, either because they believe the sunnah is limited to eight rakats or for other reasons.
Such behavior contradicts the fatwas of Shaikhs Bin Baaz, Jibreen, Munajjid, and others, as well as the saheeh hadith (see below).
On the other hand, if someone wants to pray for just eight rakats, they should visit a mosque that offers taraweeh for just eight rakats.
The Messenger (blessings and peace of Allah be upon him) is credited with encouraging congregational Taraweeh prayers, saying:
“The reward of qiyaam al-layl will be written for whoever remains with the imam until he leaves (ie 20 Rakats).”
Narrated and classed as saheeh by al-Tirmidhi (806); also narrated by Abu Dawood (1375), al-Nasaa’i (1605), and Ibn Maajah (1327). Al-Albaani also classified it as saheeh in Saheeh al-Tirmidhi.
Shaykh Ibn Baaz (may Allah have mercy on him) was asked:
Is it consistent with the Sunnah for someone to pray with someone who prays twenty-three rak’ahs (20 Tarawih and 2 Witr) during Ramadan, but he only prays eleven and does not finish the prayer with the imam?
*He replied, ‘The Sunnah is to complete the prayer with the imam, even if he prays twenty-three rak ‘ahs, because the Messenger (blessings and peace of Allah be upon him) said, “Whoever stands (in prayer) with the imam until he finishes, Allah will record for him (the reward of) spending a night in prayer.” According to another report: “… The rest of that night.”
More Detailed post: Proof of 20 tarawih from-a 20th-century salafi scholar or this post Why you will Always read 20 Tarawih, and Never 8 Tarawih