The minimum is two rak'ahs. Abu Hurayrah, may Allah be pleased with him, said that his beloved friend ﷺ advised him with three things that he would not leave until death: fasting three days of every month, two rak'ahs of Duha, and praying witr before sleeping (Sahih al-Bukhari 1981; Sahih Muslim 721).
Aisha, may Allah be pleased with her, said that the Prophet ﷺ prayed Duha four rak'ahs and added what Allah willed (Sahih Muslim 719). Umm Hani, may Allah be pleased with her, reported that on the day of the conquest of Mecca he prayed eight rak'ahs, and she had never seen a lighter prayer, though he completed the bowing and the prostration (Sahih al-Bukhari 1176).
On this basis, scholars say that Duha is two, four, six or eight rak'ahs. They differ on the upper limit: many say eight, and others permit more, since there is no text that sets a limit. It is prayed two rak'ahs at a time, with salam after each pair.