Sahih al-Bukhari, Volume 6, Book 61, Hadith 502 (USC-MSA) ⓘ
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.
حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُوسَى، عَنْ شَيْبَانَ، عَنْ يَحْيَى، عَنْ أَبِي سَلَمَةَ، قَالَ أَخْبَرَتْنِي عَائِشَةُ، وَابْنُ، عَبَّاسٍ رضى الله عنهم قَالاَ لَبِثَ النَّبِيُّ صلى الله عليه وسلم بِمَكَّةَ عَشْرَ سِنِينَ يُنْزَلُ عَلَيْهِ الْقُرْآنُ وَبِالْمَدِينَةِ عَشْرَ سِنِينَ.
also referenced under: Book 66, Hadith 1 (In-Book) & Hadith 4978 (DarusSalam)