Abu Hurairah reported,

The Prophet ﷺ said, "A servant's prayer continues to be answered as long as he does not pray for something sinful or for the severing of family ties, and as long as he does not become impatient."Someone asked, "Messenger of Allah, what does it mean to be impatient?"He replied, "It is when he says, 'I have prayed and prayed, but I do not see any answer,' and so he gives up in frustration and abandons supplication."

Muslim 6936

Sahih

حدثني أبو الطاهر أخبرنا ابن وهب أخبرني معاوية وهو ابن صالح عن ربيعة بن يزيد عن أبي إدريس الخولاني

عن أبي هريرة

عن النبي ﷺ أنه قال لا يزال يستجاب للعبد ما لم يدع بإثم أو قطيعة رحم ما لم يستعجل قيل يا رسول الله ما الاستعجال قال يقول قد دعوت وقد دعوت فلم أر يستجيب لي فيستحسر عند ذلك ويدع الدعاء

مسلم 6936صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Remembrance, supplication, Tawba, and seeking forgiveness
Chapter
Explanation that the supplicant is answered as long as he does not become impatient and say, "I supplicated but was not answered"
Numbering
Darussalam 6936
Muslim 6936