Under the caveats the Bible asserts:
Psalm 66:18
18 If I regard wickedness in my heart, The Lord will not hear;
1 Peter 3:12
12 For the eyes of the Lord are on the righteous, and his ears are open to their prayer. But the face of the Lord is against those who do evil.”
John 15:7
7 If you abide in me, and my words abide in you, ask whatever you wish, and it will be done for you.
1 John 5:14
14 This is the confidence which we have before Him, that, if we ask anything according to His will, He hears us.
James 4:3
3 You ask and do not receive, because you ask wrongly, to spend it on your passions.
And so on. There are certain stipulations, certain requirements to be met, before we can expect a positive response from God to our prayers.
Also, neither Matthew 7:7 nor James 5:20 say anything about praying a person into salvation. There is no such teaching in all of God's word.