It is narrated from Hazrat Anas (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: Sometimes a person spends his entire life or a long period of time performing good deeds, so that if he were to die in that state, he would enter Paradise. But then a change occurs in him and he becomes involved in sins. Similarly, a man remains involved in such sins for a long period of time that if he were to die in that state, he would enter Hell, but then a change occurs in him and he becomes engaged in good deeds.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 13695