Praise be to Allaah.
Taraaweeh prayer is Sunnah according to the consensus of the Muslims, as al-Nawawi (may Allaah have mercy on him) said in al-Majmoo’.
Taraaweeh prayer was encouraged by the Prophet (peace and blessings of Allaah be upon him), for example when he said: “Whoever spends the nights of Ramadaan in prayer out of faith and in the hope of reward, his previous sins will be forgiven.” Narrated by al-Bukhaari, 37; Muslim, 760
So how can it be a bid’ah when the Prophet (peace and blessings of Allaah be upon him) encouraged us to do it and the Muslims are unanimously agreed that it is mustahabb!
Perhaps the one who said that it is bid’ah meant that gathering to offer Taraaweeh prayer in the mosques is bid’ah.
This too is incorrect, because the Prophet (peace and blessings of Allaah be upon him) prayed Taraaweeh in congregation with his companions for many nights, then he stopped doing that lest it be made obligatory upon the Muslims. Then when the Prophet (peace and blessings of Allaah be upon him) died and the revelation came to an end, this concern was no longer an issue, because it could not be made obligatory after the death of the Prophet (peace and blessings of Allaah be upon him). So ‘Umar (may Allaah be pleased with him) gathered the Muslims to pray Taraaweeh in congregation. See Question no. 21740.
The time for Taraaweeh prayer is from after ‘Isha’ prayer until dawn comes. See Question no. 37768.
There is no specific number of rak’ahs for Taraaweeh prayer, rather it is permissible to do a little or a lot. The two ways mentioned in the question are both permissible.
That should be based on whatever the people in each mosque think is suitable for them.
The best is that which was proven from the Prophet (peace and blessings of Allaah be upon him), which is that he never did more then eleven rak’ahs when praying qiyaam al-layl, in Ramadaan or at other times.
Shaykh Ibn ‘Uthaymeen said, after mentioning the number of rak'ahs in Taraaweeh prayer:
The matter is broad in scope. No one should be denounced for praying eleven or twenty-three, because the matter is broader in scope than that, praise be to Allaah.
Fataawa al-Shaykh Ibn ‘Uthaymeen, 1/407
See also Question no. 9036
And Allaah knows best.