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. We ask Allaah to exalt his mention as well as that of his family and all his companions.
We do not know any correct evidence from the Book of Allaah or the Sunnah of the Prophet that the supplication of a pilgrim is accepted for forty days. However, there are some weak narrations which state that the supplication of a pilgrim is accepted without being limited to a specific period of time (forty days).
The Prophet said: "The pilgrim is forgiven and the person for whom the pilgrim supplicates is also forgiven." [Al-Haakim] Moreover, Ibn Shaybah and others reported that 'Umar said that the pilgrim is forgiven and the person for whom the pilgrim supplicates is also forgiven during the remaining days of Thul-Hijjah, Muharram and Safar and during the first ten days of Rabee' Al-Awwal. This narration has been narrated by a weak chain of narrators. Even if we suppose that the narration is correct, the meaning will still be about the pilgrim at the time of his return from pilgrimage as is clear from the narration from 'Umar. May Allaah forgive us all.
Allaah knows best.