The Prophet ﷺ stayed in Mecca for fifteen years. For seven of those years he would see light and brightness and hear a voice, and for eight years he received revelation. He then stayed in Medina for ten years.
حدثنا أبو كامل حدثنا حماد أخبرنا عمار بن أبي عمار
أقام النبي ﷺ بمكة خمس عشرة سنة سبع سنين يرى الضوء والنور ويسمع الصوت وثماني سنين يوحى إليه وأقام بالمدينة عشرا