Abu Hind narrates from Sayyiduna Mu'awiyah (may Allah be pleased with him), who said: I heard the Messenger of Allah (peace and blessings be upon him) saying: "As long as the door of repentance is not closed, the door of emigration will not be closed either; and the door of repentance will be closed when the sun rises from the west."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 17778