All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
First of all, you should know that it is a great sin that you or your wife accuse your mother of doing magic, unless you have evidence for this.
The basic principle is that one should not think evil of a Muslim and that the latter is free from guilt. This is even more emphatic in regard one's own mother. Allah says (what means): {O you who have believed, avoid much [negative] assumption. Indeed, some assumption is sin...} [Quran 49:12]
Not talking to your parents often may be considered as severing the ties with them, especially if they are harmed by this. Disobedience and undutifulness to parents, according to the scholars, is harming them by any kind of harm, be it small or big, as has been stated by As-Subki.
If what you mentioned is true, that someone is talking to you through your wife, then this may be because of magic or because your wife is possessed by a jinn. You should look for treatment by Ruqyah (healing through Quranic recitation and supplications), Athkaar (plural of Thikr [expressions of remembrance of Allah]) and supplications while avoiding going to magicians and soothsayers. Please refer to fatwas 88660 and 82918about the lawful Ruqyah.
It was very naive of you to let the devil take advantage of this situation and make you respond to him in these reprehensible things which he ordered you to do; because of that, you allowed your wife to go out unveiled and let her – apparently – go out at night and stay overnight outside the home. So what did you expect from your wife as a result of all this?
In any case, if it is proven that she is in a relationship with that man or that she was with him even once, then you should be very strict with her and oblige her to completely cut her relationship with him. You must also oblige her to wear the hijaab and prevent her from all causes of corruption; Allah 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 Allah in what He commands them but do what they are commanded.} [Quran 66:6]
As-Sa’di said about the interpretation of the above verse in his Tafseer (exegesis), “The husbands are their protectors by obliging them to abide by the commands of Allah and preserve His obligations, and to prevent them from corruption. The husbands must oblige them to do this.” Please refer to fatwa 191839.
Then if your wife repents and abides by the obedience of Allah and by the hijaab, then this is what is required; otherwise, there is no good for you to keep her as a wife and it is desirable to divorce her.
Ibn Qudamah, may Allah have mercy upon, said while clarifying the kinds of divorce, “The fourth, which is desirable, is when the wife is negligent about the rights of Allah, such as the prayer and the like, and he is unable to force her to do so, or when he has a wife who is not chaste...”
Being negligent about the prayer is one of the means that lead to committing immorality (fornication or adultery); on the contrary, preserving the prayer is a means that protects a person from that; Allah says (what means): {Indeed, prayer prohibits immorality and wrongdoing.} [Quran 29:45]
If we presume that divorce takes place, then your wife has no right to the custody of your children, because, according to the most preponderant opinion of the scholars, dissoluteness (Fisq) prevents the mother from taking custody. Please refer to fatwa 287512.
Therefore, the custody of the children is transferred to the females who are suitable after her to foster them according to the sequence order mentioned by the scholars, which we clarified in fatwa 84618.
Allah knows best.