كتاب الفضائل
43  
The Book of Virtues
(33)
Chapter: How Long Did The Prophet ft Stay In Makkah And Al-Madinah?
(33)
باب كَمْ أَقَامَ النَّبِيُّ صلى الله عليه وسلم بِمَكَّةَ وَالْمَدِينَةِ ‏.‏
Sahih Muslim 2350 b

'Amr reported:

I said to 'Urwa: How long did Allah's Apostle (ﷺ) stay in Mecca? He said: For ten years. I said: Ibn Abbas says it is some years above ten. He ('Urwa) sought forgiveness for him and said: His statement is based on the verse of a poet.
وَحَدَّثَنَا ابْنُ أَبِي عُمَرَ، حَدَّثَنَا سُفْيَانُ، عَنْ عَمْرٍو، قَالَ قُلْتُ لِعُرْوَةَ كَمْ لَبِثَ النَّبِيُّ صلى الله عليه وسلم بِمَكَّةَ قَالَ عَشْرًا ‏.‏ قُلْتُ فَإِنَّ ابْنَ عَبَّاسٍ يَقُولُ بِضْعَ عَشْرَةَ ‏.‏ قَالَ فَغَفَّرَهُ وَقَالَ إِنَّمَا أَخَذَهُ مِنْ قَوْلِ الشَّاعِرِ ‏.‏
Reference : Sahih Muslim 2350b
In-book reference : Book 43, Hadith 153
USC-MSA web (English) reference : Book 30, Hadith 5800
  (deprecated numbering scheme)