The maximum reported for the Duha prayer is eight rakʿahs, based on the narration of Umm Haniʾ that, in the year of the Conquest, the Prophet prayed eight rakʿahs of the Duha prayer; this was collected by all the major compilers. Muslim also relates from ʿAʾishah (may Allah be pleased with her) that “the Prophet would pray four rakʿahs of Duha and then add as many more as Allah willed.”
The time for the Duha prayer begins when the sun has risen roughly a spear’s length above the horizon and continues until shortly before the sun reaches its zenith. The preferred time, however, is when the heat of the day becomes intense, in light of the ḥadīth, “The prayer of the penitent is offered when the young camels feel the scorching heat,” narrated by Muslim—that is, when the ground grows so hot that the young camels kneel down from the sweltering heat.