The Prophet (ﷺ) stayed for ten years in Mecca with the Qur'an being revealed to him and he…

Sahih al-Bukhari Book 64 Hadith 480

Sahih al-Bukhari #4464, 4465

Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi) 64:480

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.'

Chapter: The death of the Prophet (saws)

Grade: Sahih