All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The Sharee’ah made the husband the guardian of his wife as Allaah says (what means): {Men are in charge of women by [right of] what Allaah has given one over the other and what they spend [for maintenance] from their wealth.}[Quran 4:34]
Therefore, the husband is obliged by virtue of that guardianship to discipline his wife and prevent her from anything that could lead to corrupting her; Allaah says (what means): {O you who have believed, protect yourselves and your families from a Fire whose fuel is people and stones, over which are [appointed] angels, harsh and severe; they do not disobey Allaah in what He commands them but do what they are commanded.}[Quran 66:6] Ibn ‘Abbaas said while interpreting this verse: “It means teach them and discipline them.”
A woman chatting with non-Mahram men is reprehensible and a means of evil and corruption, so you are obliged to prevent your wife from this, and she is obliged to obey you in this regard as a woman is obligated to obey her husband in what is permissible. Abu Hurayrah narrated that the Prophet said: "If I were to order someone to prostrate to another person, I would have ordered the wife to prostrate to her husband.” [At-Tirmithi]
If she becomes righteous and stops what she is doing, then praise be to Allaah, otherwise she is a recalcitrant wife and her husband is obliged to discipline her according to the teachings of the Sharee’ah, which we have previously clarified in Fatwa 85402. If she is deterred, then this is what is required; otherwise, you should consider divorcing her.
For more benefit, please refer to Fatwa 82073.
Allaah Knows best.