The evidence that it may be performed as eight rak'ahs is the hadith of Umm Hāni’, who reported: “In the year of the Conquest, I came to the Messenger of Allah, peace and blessings be upon him, while he was in the upper part of Mecca. The Messenger of Allah, peace and blessings be upon him, went to bathe, and Fātima screened him. He then took his garment, wrapped himself in it, and performed eight rak'ahs as the voluntary Duhā prayer.” (1) Recorded by al-Bukhārī and Muslim. (2)
The evidence that it may be performed as twelve rak'ahs is the hadith of Abū al-Dardā’, may Allah be pleased with him. He reported that the Messenger of Allah, peace and blessings be upon him, said: “Whoever performs two rak'ahs of Duhā will not be recorded among the heedless; whoever performs four will be recorded among the devout worshippers; whoever performs six will be sufficed for that day; whoever performs eight, Allah will record him among the devoutly obedient; and whoever performs twelve rak'ahs, Allah will build for him a house in Paradise. No day or night passes without Allah bestowing a charitable favor upon His servants, and Allah bestows no favor upon any of His servants greater than inspiring him to remember Him.” Recorded by al-Tabarānī. (3)