Can a person be possessed by the jinn when he is keeping up with adhkaar? And how can one treat possession by an infatuated jinni?
Question

Why are prayer and the adhkaar for morning and evening, and before going to sleep, not sufficient to protect the Muslim from the transgression of the jinn against him (possession by one who is infatuated)? Even though he prays on time and always recites the adhkaar for morning and evening, and before going to sleep, the jinn still come to him in his dreams, and there happens intercourse despite that, and other things.
Praise be to Allah.Firstly:
The basic principle is that adhering to the obligatory duties and always reciting the adhkaar for morning and evening, and before going to sleep, will protect a person from being overpowered by the jinn. But a person may go through a time when he is heedless, at which time the jinni may enter his body, or possession may have occurred before he began to adhere to regularly reciting adhkaar, so he needs to be treated with ruqyah, or that treatment needs to be repeated, and that will not go away with adhkaar alone; rather keeping up with adhkaar will weaken the impact of the possession and may take it away altogether.
Shaykh Saalih al-Fawzaan (may Allah preserve him) was asked: We find that some people are affected by possession or the evil eye even though they protect themselves with adhkaar in the morning and evening. What is the guideline concerning that?
He replied: If Allah wills that something should befall him, the person will fail to recite dhikr on that day; either he will forget it or he will be distracted from it.
End quote from:
www.al-fawzan.af.org.sa/node/14626
Secondly:
Possession may be treated by means of ruqyah as prescribed in Islamic teachings, done by someone who adheres to the Sunnah, and by regularly reciting the adhkaar for morning and evening, when going to sleep, when entering the bathroom, when taking off clothes, and when eating and drinking, and reflecting on the meanings when saying those adhkaar, with focus and presence of mind, and going to sleep in a state of purity. We also advise you to humbly beseech Allah (may He be exalted) and ask Him to take away what you are suffering and to heal you and grant you well-being.
Shaykh ‘Abdullah al-Jibreen (may Allah have mercy on him) said: Some of the jinn may appear to a man in the form of a woman, then the human has intercourse with her, or a jinni may appear in the form of a man and have intercourse with a human woman, as a man has intercourse with a woman.
The remedy for that is:
to protect oneself from them, both male and female, by means of the du ‘aa’s and awraad narrated in the religious texts, and reciting verses that speak of seeking protection and guarding against them, by Allah’s leave.
End quote from Fataawa ‘Ulama’ al-Balad al-Haraam, p. 1546.
See also the answer to question no. 9577.
We ask Allah to heal you and grant you well-being.
And Allah knows best.