Prayer and Miracles
There are numerous conditions when it comes to prayer and working miracles. First of all, Matthew 7:7 is in the context of Jesus' broader comments on prayer, (cp. Luke 11:1-13) that we should pray without repetition or asking for physical possessions, since God knows what we need without us asking Him. (Matthew 6:7-8) We are told not to concern ourselves in prayer with material possessions but treasure in Heaven, and that our hearts will only be in Heaven if that is where our treasure is. (Matthew 16:19-21) We should be content with food and clothing from God, seeking first God's kingdom and His righteousness. (Matthew 6:25-34)
Furthermore, Jesus' statement that if we ask we will receive was made concerning God's giving of the Holy Spirit to those who ask. (Luke 11:9-13) We are commanded to additionally pray, first and foremost, that God's will be done, not our own. (Matthew 6:9; Luke 11:2) Aside from food and clothing, we should not be asking for anything physical. (Matthew 6:11,25; Luke 11:3; 12:22-31) It is only when seeking God's kingdom first that we can expect God to eventually, in His own time, add more. (Matthew 6:33; Luke 12:31) Nor will this necessarily be in this life; we should be most concerned with treasures in the Kingdom of Heaven. (Luke 12:32-33; Matthew 6:19-20)
We can only expect God to receive our petitions if we are asking according to His will, after the manner Jesus taught us to pray in Matthew 6-7 and Luke 11-12. (1 John 5:14-15) Faith is more than just believing that God exists, but doing God's commandments because we trust in Him. (1 John 3:22-24) God does not hear prayers from those He has no relationship with, and for Him to hear us, we must have fully cleansed hearts, walking in full confidence and purity towards Him. (Hebrews 10:22-23) One thing that is freely given by God is wisdom, so long as those asking for it ask in faith without doubting. (James 1:5-7) Receiving from God is contingent not just upon asking God, but asking correctly in humility, out of love rather than lust, having submitted ourselves to God, drawing near to Him, with cleansed hands and purified hearts. (James 4:2-10)
As David writes in the Psalms, "If I regard iniquity in my heart, the Lord will not hear me." (Psalms 66:18) God only hears the prayer of the righteous. (Proverbs 15:29; 28:29; Isaiah 1:15) The blind man Jesus healed testified to this, saying "Now we know that God heareth not sinners: but if any man be a worshipper of God, and doeth his will, him he heareth." (John 9:31) Those who have despised God will be ignored by Him when trouble comes upon them. (Proverbs 1:29-30; Jeremiah 14:10-12) Those who have done evil to others and did not show mercy to them will be similarly be ignored by God during their times of trouble. (Zechariah 7:12-13; Micah 3:3-4; Ezekiel 8:17-18)
Receiving by asking in the name of Jesus (John 14:13-14) is contingent upon us abiding in Jesus and His words abiding in us, so that we do all of His commandments. (John 15:7) We are only Jesus' disciples if bearing fruit. (John 15:8) Furthermore, it requires two Christians agreeing upon something, not just one, in some cases. (Matthew 18:19) Prayer in faith, being able to work miracles, involves a holy, righteous life that seeks the glory of Jesus and God the Father, to do the Father's will not ours, asking in humility while focused on rewards in Heaven, not on Earth, having helped others as we hope for God to help us, ideally asking in fellowship with another Christian who meets those requirements.
Answered prayers follow after holiness. We should first be asking that if there is anything in our hearts not according to God's will that He will change us. Only when our hearts are right and pure before God can we expect to start asking for miracles. Put simply, we cannot expect God's blessings unless we are doing His will.