The Messenger of Allah ﷺ remained in Makkah for fifteen years. For seven of those years he would hear a voice and see a light without seeing anything else, and for eight years revelation came to him. He then remained in Madinah for ten years.
و حدثنا إسحق بن إبراهيم الحنظلي أخبرنا روح حدثنا حماد بن سلمة عن عمار بن أبي عمار
أقام رسول الله ﷺ بمكة خمس عشرة سنة يسمع الصوت ويرى الضوء سبع سنين ولا يرى شيئا وثمان سنين يوحى إليه وأقام بالمدينة عشرا