Sahih al-Bukhari 4464
Sahih al-Bukhari · Book 64: Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi) · The death of the Prophet (saws)
Narrated Aisha and Ibn `Abbas:
حَدَّثَنَا أَبُو نُعَيْمٍ ، حَدَّثَنَا شَيْبَانُ ، عَنْ يَحْيَى ، عَنْ أَبِي سَلَمَةَ ، عَنْ عَائِشَةَ ، وَابْنِ، عَبَّاسٍ رضى الله عنهم أَنَّ النَّبِيَّ صلى الله عليه وسلم لَبِثَ بِمَكَّةَ عَشْرَ سِنِينَ يُنْزَلُ عَلَيْهِ الْقُرْآنُ، وَبِالْمَدِينَةِ عَشْرًا.
The Prophet (ﷺ) stayed for ten years in Mecca with the Qur'an being revealed to him and he stayed in Medina for ten years.'