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