A lot of ink has been spilled on this passgae:
And I tell you that you are Peter, and on this rock I will build my church, and the gates of Hades will not overcome it. I will give you the keys of the kingdom of heaven; whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven. (Matt. 16:18-19)
Johnathan Leeman gives us his take on the passge:
The state’s representative authority, we said in chapter one, is seen most clearly in its ability to end a person’s life. Likewise, the church’s representative authority in Christ’s kingdom is seen most clearly in its ability to remove a person from citizenship in Christ’s kingdom. In both cases, the full extent of institutional authority is indicated by the power to decisively end a person’s membership, through death in one case and excommunication in the other.
Yet it’s the same authority which is exercised when “two or three come together in [Jesus’] name” (Matt. 18:20) and baptize a person “in the name of the Father and of the Son and of the Holy Spirit” (Matt. 28:19), licensing the person as an official, card-carrying disciple. No, it’s not an absolute authority, any more than the state is. But Christ does mean for Christians to submit to the oversight of local churches by virtue of their citizenship in his kingdom.
Will the local church exercise the keys perfectly? No. It will make mistakes just like every other authority established by Jesus makes mistakes. As such, the local church will be an imperfect representation of Christ’s end-time gathering. But the fact that it makes mistakes, just like presidents and parents do, does not mean it’s without an authoritative mandate.
Does all this mean that what a local church does on earth actually changes a person’s status in heaven? No, the church’s job is like an ambassador’s or an embassy’s. Remember what I said about visiting the U.S. Embassy in Brussels when my passport expired. The embassy didn’t make me a citizen, it formally affirmed it in a way I could not myself. So with a local church.
You can read Leeman’s comments on this topic HERE or in his new book Church Membership: How the World Knows Who Represents Jesus.