The Women - 4:140 He has revealed to you in the Book: When you hear that the verses of Allah are denied and mocked, do not sit with them until they have moved on to another talk, lest you become like them. Allah will gather all hypocrites and disbelievers in Hell.
Related:
The Cattle/6:108 And do not curse those whom they invoke besides Allah, lest they also transgress the limit and curse Allah out of ignorance. This is how We have made every community adorn what they used to do, and to their Lord is their return, and He will inform them of what they used to do.

The Women/4:140 He has revealed to you in the Book: When you hear that the verses of Allah are denied and mocked, do not sit with them until they have moved on to another talk, lest you become like them. Allah will gather all hypocrites and disbelievers in Hell.

The Cattle/6:68 And when you see those who mock at Our signs and Our miracles, turn away from them until they are absorbed in another speech. And if Satan makes you forget, do not sit with such unjust people after you have remembered.

The One Covering Himself/73:10 Be patient with their words and part from them with kindness.