Part of the complex answer to this question could be that one is being tested or the TIME isn't right. For example, Zachariah prayed for a son. YEARS LATER, when all hope was gone in the natural and the TIME was right, it came to pass! The answer was delayed because the TIME wasn't right when he asked, even though it was God's will for him to have a son! See Lk. 1:13-20.
There are at least six other reasons, not related to timing, why our prayers are not answered quickly. Hindrances to answered prayer are very important to know about. If we are aware of them and correct the problem(s), then we'll see prayer results. [This is similar to various hindrances that exist in driving a car, such as a flat tire, an obscured windshield, expired inspection or license, mechanical breakdowns, etc. No one would lose faith in driving a car because such hindrances exist! Why then isn't praying viewed this way?]
Listed below are the six main hindrances to answered prayer. Correct them, if they exist (as you would correct driving hindrances):
1. Cherishing sin in your heart. "If I had cherished sin in my heart, the Lord would not have listened" (Psa. 66:18). See also Zech. 7:13; Jonah 2:8 and 1 Jn. 3:21,22. Repent of your sins. Crucify the flesh and follow Jesus faithfully. No sin is worth going to hell over. Remember also to forgive others who sin against you. Jesus taught, "And when you stand praying, if you hold anything against anyone, forgive him, so that your Father in heaven may forgive you your sins" (Mk. 11:25). That goes with this passage about obedience:
Dear friends, if our hearts do not condemn us, we have confidence before God and receive from him anything we ask, because we obey his commands and do what pleases him. (1 John 3:21,22)
2. Not being persistent in prayer. Jesus said, "I tell you, though he will not get up and give him the bread because he is his friend, yet because of the man's persistence he will get up and give him as much as he needs" (Lk. 11:8). [The ultimate in prayer power seems to be in persistence, according to Isa. 1:15.] Cf. Lk. 18:1.
3. Improper treatment of spouse. "Husbands, in the same way be considerate as you live with your wives, and treat them with respect as the weaker partner and as heirs with you of the gracious gift of life, so that nothing will hinder your prayers" (1 Pet. 3:7).
4. Doubt. "But when he asks, he must believe and not doubt, because he who doubts is like a wave of the sea, blown and tossed by the wind. That man should not think he will receive anything from the Lord; he is a double-minded man, unstable in all he does" (Jam. 1:6-8).
5. Asking with wrong motives. "When you ask, you do not receive, because you ask with wrong motives, that you may spend what you get on your pleasures" (Jam. 4:3).
6. Neglecting the poor. "If a man shuts his ears to the cry of the poor, he too will cry out and not be answered" (Prov. 21:13). See also Prov. 28:27.
Don't let hindrances to answered prayer to remain in your way. Remedy the problems and things will get better in more than one spiritual way.