The narration of Muslim is: "The supplication of a slave continues to be granted as long as he does not supplicate for a sinful thing or for something that would cut off the ties of kinship and he does not grow impatient." It was said: "O Messenger of Allah! What does growing impatient mean?" He (PBUH) said, "It is one's saying: 'I supplicated again and again but I do not think that my prayer will be answered.' Then he becomes frustrated (in such circumstances) and gives up supplication altogether."
Commentary: We learn from this Hadith that one should continue beseeching Allah without ever thinking that in spite of praying for a long time, his prayer has not been granted. One should never allow frustration to overcome in his mind. If a person's supplication is not granted for a long time, there would be certainly some good for him in that delay the reason of which is known to Allah Alone. It is, therefore, essential that he should never cease to pray whether his prayer is granted or not. Persistence in prayer is certainly beneficial to him.