The Prophet ﷺ stayed for ten years in Mecca with the Qur'an being revealed to him and he stayed in Medina for ten years.' (Using translation from Bukhārī 4464)
أَنَّ رَسُولَ اللهِ ﷺ «لَبِثَ بِمَكَّةَ عَشْرَ سِنِينَ يُنَزَّلُ عَلَيْهِ الْقُرْآنُ وَبِالْمَدِينَةِ عَشْرًا»