Ayesha reported,

The Messenger of Allah ﷺ used to pray four rakahs of Duha, and he would add to that as much as Allah willed.

Muslim 1665

Sahih

و حدثني يحيى بن حبيب الحارثي حدثنا خالد بن الحارث عن سعيد حدثنا قتادة أن معاذة العدوية حدثتهم

عن عائشة قالت

كان رسول الله ﷺ يصلي الضحى أربعا ويزيد ما شاء الله

مسلم 1665صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Travelers' prayer and its shortening
Chapter
Recommendation of Duha prayer, that its minimum is two rakahs and its most complete is eight rakahs and its middle is four or six rakahs, and the encouragement to maintain it
Numbering
Darussalam 1665
Muslim 1665