Sahih al-Bukhari 4978
Sahih al-Bukhari · Book 66: Virtues of the Qur'an · How the Divine Revelation used to be revealed and what was the first thing revealed
Narrated `Aisha and Ibn `Abbas:
حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُوسَى ، عَنْ شَيْبَانَ ، عَنْ يَحْيَى ، عَنْ أَبِي سَلَمَةَ ، قَالَ أَخْبَرَتْنِي عَائِشَةُ ، وَابْنُ، عَبَّاسٍ رضى الله عنهم قَالاَ لَبِثَ النَّبِيُّ صلى الله عليه وسلم بِمَكَّةَ عَشْرَ سِنِينَ يُنْزَلُ عَلَيْهِ الْقُرْآنُ وَبِالْمَدِينَةِ عَشْرَ سِنِينَ.
The Prophet (ﷺ) remained in Mecca for ten years, during which the Qur'an used to be revealed to him; and he stayed in Medina for ten years.