One of the most misunderstood passages in the Bible is Matthew 18:19-20 which says,
Again I say to you, that if two of you agree on earth about anything that they may ask, it shall be done for them by My Father who is in heaven. “For where two or three have gathered together in My name, I am there in their midst.”
When Jesus says that he will be in our midst if there are two or three gathered, does that mean that our prayers are more powerful, successful, or holy if we get more people together to pray? Does it mean that if we can get two Christians to pray for a certain result that God will automatically answer their prayer? (If you have tried to get some of your brothers or sisters in Christ together and prayed for a million dollars, then you probably figured out that it does not work that way.)
Context is King
Matthew 18:19-20 comes right off the cusp of verses 15-18 that talk about the process and power of church discipline. Some Bibles have a paragraph break there to indicate that the topics are not joined, but in fact they are.
In verse 18 we are told that if we go through the process of Church discipline in a righteous way the results will be binding, and that when the church restores that person those results will be implemented as well. Jesus gives the church authority to judge within its walls the unrepentant (notice that this is for those in the church, not outside.)
In Jesus’ Name
Gathering in Jesus’ name does not mean that we can do anything we want in the name of Jesus; rather this means that we should be gathering and praying according to Jesus’ will, submitting to Jesus’ authority, coming to the Father by the position of Jesus. All our actions have to fall under the category of righteous actions.
Agree About Anything
As mentioned above, even if you get your friends together and you all agree that having a million dollars tomorrow is God’s will and that you all will spend the day praying for it, that still doesn’t guarantee that you’ll get your “answer to prayer.” The Greek usage of the word “anything” helps us to understand what is meant here, for that word is often limited to judicial matters which makes a lot of sense if you have verse 15-18 for context: the church is acting in a judicial manner, and the things that it asks for in the binding and losing will be done for it. 
Two or Three
The point in verses 19-20 that is being made is, that no matter how small the fellowship of believers, God hears them as clearly as He hears the prayers of a large fellowship of believers. The smallest number is therefore placed as the example – you can have a church of just two or three people, and that body would still be heard by God if it is acting according to his will.
While we can’t ask for a million dollars and expect Jesus to give it to us, these verses should remind us to take Matthew 18 very seriously. When the church acts in a way that is in accordance with his will, those decisions will be binding. Let these verses remind you that God promises to listen and act. God has given authority to the local church and is serious about sin. If you have been struggling with taking the local church seriously, let these verses remind you how serious God takes it.
We should also find hope and joy in knowing that Jesus is gathered in our midst. To the disciples these would have been comforting words to recall after Jesus’ death. When you gather together on Sunday with your fellow believers, rest assured that Jesus is there with you no matter how large or small the congregation.
 Blomberg, Craig. Matthew. Vol. 22. The New American Commentary. Nashville: Broadman & Holman Publishers, 1992.