If someone eats something haram knowingly and repents, after how long will Allah begin to accept his/her dua again?
You eat haraam food -knowingly or unknowingly- undoubtedly it'll cause your du’as to be rejected, Because it is reported in a couple of Sahih hadeeth........
1| The sayings of our beloved Prophet Mohammed swa's regarding rejection of someone's prayers for forty days who drinks Alcohol and gets drunk is mentioned below :-
It was narrated from ‘Abdullah bin ‘Amr that the Messenger of Allah (ﷺ) said: “Whoever drinks wine and gets drunk, his prayer will not be accepted for forty days, and if he dies he will enter Hell, but if he repents, Allah will accept his repentance. If he drinks wine again and gets drunk, his prayer will not be accepted for forty days, and if he dies he will enter Hell, but if he repents, Allah will accept his repentance. If he drinks wine again and gets drunk, his prayer will not be accepted for forty days, and if he dies he will enter Hell, but if he repents Allah will accept his repentance. But if he does it again, then Allah will most certainly make him drink of the mire of the puss or sweat on the Day of Resurrection.” They said: “O Messenger of Allah, what is the mire of the pus or sweat? He said: “The drippings of the people of Hell.” Grade: Sahih (Darussalam)
Reference : Sunan Ibn Majah 3377 In-book reference : Book 30, Hadith 7 English translation : Vol. 4, Book 30, Hadith 3377
2| And then He (swa) stated a resembles those who eat Haram, wear Haram like----------
A man who travels a great deal and becomes disheveled and covered with dust, who raises his hands to the heavens (and says), ‘O Lord, O Lord,’ when his food is haraam, his drink is haraam, his clothes are haraam and he has been nourished with haraam, so how can he receive a response? (Narrated by Muslim in his Saheeh).
And now we need to understand what does it mean by “his prayer will not be accepted”! In that regard Abu ‘Abd-Allaah ibn Mandah and Al-Nawawi said :-
Abu ‘Abd-Allaah ibn Mandah said: The words “his prayer will not be accepted” mean that he will not be rewarded for his prayer for forty days, as a punishment for his drinking alcohol, just as they say that the one who speaks on Friday when the imam is delivering the khutbah should pray Jumu’ah but there is no Jumu’ah for him, meaning that he will not be given the reward for Jumu’ah as a punishment for his sin. Ta’zeem Qadr al- Salaah, 2/587, 588. See also question no.
Al-Nawawi said: With regard to his prayer not being accepted, what this means is that he will not be rewarded for it, even though it is valid in the sense that he has discharged his duty and does not need to repeat it. End quote.