Sahih al-Bukhari Book 86, Hadith 38
Allah's Messenger (ﷺ)s said, "When a slave (of Allah) commits illegal sexual
intercourse, he is not a believer at the time of committing it; and if
he steals, he is not a believer at the time of stealing; and if he
drinks an alcoholic drink, when he is not a believer at the time of
drinking it; and he is not a believer when he commits a murder,"
'Ikrima said: I asked Ibn Abbas, "How is faith taken away from him?"
He said, Like this," by clasping his hands and then separating them,
and added, "But if he repents, faith returns to him like this, by
clasping his hands again.
I will narrate to you a narration which nobody will narrate to you after me. I heard that from the Prophet. I heard the Prophet (ﷺ) saying, "The Hour will not be established" or said: "From among the portents of the Hour is that the religious knowledge will betaken away (by the death of religious Scholars) and general ignorance (of religion) will appear; and the drinking of alcoholic drinks will be very common, and (open) illegal sexual intercourse will prevail, and men will decrease in number while women will increase so much so that, for fifty women there will only be one man to look after them."
The Prophet (ﷺ) said, "The one who commits an illegal sexual intercourse is not a believer at the time of committing illegal sexual intercourse and a thief is not a believer at the time of committing theft and a drinker of alcoholic drink is not a believer at the time of drinking. Yet, (the gate of) repentance is open thereafter."