The adulterer is not a believer at the moment he commits adultery, the thief is not a believer at the moment he steals, and the drinker of wine is not a believer at the moment he drinks. He mentioned a fourth, but I have forgotten it. When a person does any of these, he removes the bond of Islam from his neck. But if he repents, Allah accepts his repentance.
أخبرنا محمد بن يحيى المروزي أبو علي قال حدثنا عبد الله بن عثمان عن أبي حمزة عن يزيد وهو ابن أبي زياد عن أبي صالح
لا يزني الزاني حين يزني وهو مؤمن ولا يسرق وهو مؤمن ولا يشرب الخمر وهو مؤمن وذكر رابعة فنسيتها فإذا فعل ذلك خلع ربقة الإسلام من عنقه فإن تاب تاب الله عليه
Sourcing, its isnad is daif, and it appears in Al-Kubra, hadith no. 7357. Yazid is Ibn Abu Ziyad, who is daif, a mudallis, and whose memory became confused. Part of the hadith has corroborating witnesses, apart from his statement, "If he does that, he has removed..." and so on.