Ayesha and Abdullah bin Abbas reported,

The Prophet ﷺ remained in Mecca for ten years while the Quran was being revealed to him, and in Medina for another ten years.

Bukhari 4978-4979

Sahih

حدثنا عبيد الله بن موسى عن شيبان عن يحيى عن أبي سلمة قال

أخبرتني عائشة وابن عباس رضي الله عنهم قالا

لبث النبي ﷺ بمكة عشر سنين ينزل عليه القرآن وبالمدينة عشر سنين

البخاري 4978-4979صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Virtues of the Quran
Chapter
How revelation descended and what was revealed first
Numbering
Darussalam 4978-4979
Bukhari4978 4978-4979