There’s a famous narration regarding wine which says the prayer of its imbiber will not be accepted for forty days! (Mustadrak al-Wasa’il, Vol. 17, P. 57) However it is worthy to know that there’s another sin which is worse than drinking wine and if a person commits that besides his prayers, his fasts will not be accepted for forty days either.
The Holy Prophet (S) says:
Whoever backbites a Muslim man or a Muslim woman God will not accept his prayers nor his fasts for forty days except if that Muslim forgives him.
Bihar al-Anwar, Vol. 75, P. 258