Making fun of Islam and repenting from it
Praise be to Allah.
Firstly:
Undoubtedly mocking and making fun of something that is known to be part of Islam constitutes kufr (disbelief) that puts one beyond the pale of Islam, even if the one who does that does not mean anything more than joking, because this in and of itself is an action that puts one beyond the pale of Islam as Allah, may He be exalted, says (interpretation of the meaning):
“If you ask them (about this), they declare: ‘We were only talking idly and joking.’ Say: ‘Was it at Allah, and His Ayaat (proofs, evidences, verses, lessons, signs, revelations, etc.) and His Messenger (blessings and peace of Allah be upon him) that you were mocking?
Make no excuse; you have disbelieved after you had believed. If We pardon some of you, We will punish others amongst you because they were Mujrimoon (disbelievers, polytheists, sinners, criminals, etc.)”
[at-Tawbah 9:65-66].
Please see the answers to questions no. 175838 and 111473
What the one who is present in such a gathering must do is denounce that. If he cannot do that, then he must leave the gathering, so that he will not be a partner in the sin. If he expresses any kind of approval of their actions and words, then he is like them. Allah, may He be exalted, says (interpretation of the meaning):
“And when you (Muhammad (blessings and peace of Allah be upon him)) see those who engage in a false conversation about Our Verses (of the Quran) by mocking at them, stay away from them till they turn to another topic. And if Shaitan (Satan) causes you to forget, then after the remembrance sit not you in the company of those people who are the Zalimoon (polytheists and wrongdoers, etc.)”
[al-An‘aam 6:68]
“And it has already been revealed to you in the Book (this Quran) that when you hear the Verses of Allah being denied and mocked at, then sit not with them, until they engage in a talk other than that; (but if you stayed with them) certainly in that case you would be like them. Surely, Allah will collect the hypocrites and disbelievers all together in Hell”
[an-Nisa’ 4:140].
Allah, may He be glorified and exalted, regards the one who sits in a gathering and witnesses evil, if he does not denounce it, as being like the one who does or speaks that evil.
Hence it is said that the one who listens is the partner of the one who backbites. According to a report, the one who witnesses sin but hates it is like the one who was absent from it, and the one who was absent from it but approves of it is like the one who witnessed it.
Shaykh al-Islam ibn Taymiyah said:
When some of them made fun of (the believers) and said concerning those with whom Allah is pleased, “We have never seen anyone like our people who are well-versed in the Qur’an when it comes to eating more or telling more lies or being more cowardly when meeting the enemy,” Allah revealed the words (interpretation of the meaning):
“The hypocrites fear lest a Soorah (chapter of the Quran) should be revealed about them, showing them what is in their hearts. Say: "(Go ahead and) mock! But certainly Allah will bring to light all that you fear.’
If you ask them (about this), they declare: ‘We were only talking idly and joking.’ Say: ‘Was it at Allah, and His Ayaat (proofs, evidences, verses, lessons, signs, revelations, etc.) and His Messenger (blessings and peace of Allah be upon him) that you were mocking?
Make no excuse; you have disbelieved after you had believed. If We pardon some of you, We will punish others amongst you because they were Mujrimoon (disbelievers, polytheists, sinners, criminals, etc.)”
[al-Munaafiqoon 9:64].
Allah informed them that they had disbelieved after having believed, even though they said, “We say words of disbelief without believing in them; rather we were just talking idly and joking.” He explained that mocking the revelations of Allah constitutes kufr, and such words cannot be uttered except by someone who is content with such words, for if he had faith in his heart, it would have prevented him from saying such words.
End quote from al-Eemaan (2/284)
Secondly:
Undoubtedly making fun of any aspect of Islam is contrary to respect and veneration for this religion, especially with regard to matters such as the punishment on the Day of Resurrection, or in the grave, or the terrors of the resurrection. Islam has only told us of these things so as to alarm people and set their hearts straight, so that they will not persist in heedlessness. One of the greatest forms of heedlessness, which is indicative of being overwhelmed by ignorance, whims and desires, and lack of insight, is when one regards matters of exhortation and admonition as a joke and something to be laughed at and made fun of.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said concerning these hypocrites who make fun of Islam:
This indicates that they did not themselves think that they had committed an act of kufr; rather they thought that that did not constitute kufr. So Allah explained that ridiculing Allah and His revelations and His Messenger constituted kufr and meant that the person had disbelieved after having believed. This indicates that they had faith, albeit weak, and they did this haraam action knowing that it was haraam, but they did not think that it constituted kufr. However it was kufr by means of which they became disbelievers, although they did not think that it was permissible.
End quote from Majmoo‘ al-Fataawa (7/273)
The one who falls into such error must renew his faith by uttering the Shahaadatayn (twin declaration of faith) and repent sincerely from what he has done. As for the Shahaadatayn, uttering it in the prayer or in the rituals of ‘Umrah is sufficient.
It says in Kashshaaf al-Qinaa‘ (6/181):
If the disbeliever prays or gives the adhaan (call to prayer), he is deemed to be a Muslim, regardless of whether he was originally a disbeliever or had apostatised. End quote.
With regard to repentance, it is essential to repent sincerely and specifically from that great evil.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: Whoever speaks a word of kufr, even in jest, has disbelieved. He must repent and must believe that he is repenting from apostasy. So he must renew his Islam, for the revelations of Allah, may He be glorified and exalted, and His Messenger, are too great to be mocked or ridiculed.
End quote from Liqaa’aat al-Baab al-Maftooh (60/12)
What you have mentioned about your friends is no excuse for you not to alert them to the serious sin that they have committed; rather what you must do is tell them about the ruling on what they have done, so that they may repent to Allah, may He be exalted, from it, and they may regret it and be careful not to go back to it again.
You can read this message to them, as an answer to your question, and similar answers having to do with the Islamic ruling on that.
Please see the answer to question no. 153656 and 163627
And Allah knows best.