First of all, it is to be noted that Tarawih prayer is a Sunnah that is highly recommended. In the Hadith reported by Salman Al-Farisi (may Allah be please with him), the Prophet (peace and blessings be upon him) addressed the people saying: “O people, a blessed and holy month comes to you spreading its shade on you, a month in which Allah made fasting obligatory and staying up at night in worship (i.e. performing Tarawih) as an optional act. In this month there is a single night which is better than a thousand months…”

As for the number of unit rak`a in Tarawih as performed by the Prophet (peace and blessings be upon him), we would like to furnish you with the following fatwa issued by Sheikh Ahmad Kutty who states:

“As far as Tarawih is concerned, it is a nafl or a recommended prayer and there is no fixed number for it. When the Prophet (peace and blessings be upon him) was asked about optional night prayer he replied: “One should perform the night prayer two rak`ah, then two rak`ah, etc. And when he feels the arrival of the dawn he should close it off by offering witr, even if it is by praying one rak`ah.”
Traditionally, Muslims have observed 8 rak`ah or 20, or 30, or 40 rak`ah in various circumstances. So, as Imam Ibn Taymiyyah said, it is up to the decision of the Imam and the worshippers; if they can perform 8 rak`ah while reading the same portion of the Qur’an that one would read while praying 20 rak`ah, they may do so.
However, if the Imam feels that the congregation cannot endure long recitation with fewer number of rak`ah, then, he can increase the number of rak`ah and reduce the portion of recitation in each rak`ah.

In conclusion, we can say that the Prophet’s way of offering optional prayer at night through the whole year can be applied to Tarawih Prayer, by virtue of analogy.”

In view of the above explanation, it becomes clear that the number of rak`a in tarawih Prayer may be 8 or 20 rak`a according to the decision of the imam and the praying people. May Allah forgive our sins and accept our good deeds and grant us Paradise, amen