Good questions - many people wonder about statements similar to those found in these passages in Matthew.
If you’ll notice right before Matthew 16:19, Peter had just said in verse 16 that Jesus was the Christ, the Son of the living God. Jesus then congratulates him on that all-important confession of faith, and He tells Peter that this is the rock upon which He will build His church.
Now some people take him to mean that Peter himself is the rock that Jesus is talking about here - because He addresses Peter directly, saying, Thou art Peter, and upon this rock I will build my church.
But Peter himself later denies that he is the rock the church is built upon. In I Peter 2:3-8, he says that Jesus is actually the chief cornerstone upon which the church is built, and all of His followers are like living stones being built into the temple of God.
So why does Jesus address Peter so personally when He says upon this rock I will build my church? Because Peter’s name actually means “rock” - we get the word “petrified” from it. He’s calling attention to the irony that the man whose name means rock is the very one who first articulated that statement of faith that Jesus is the Son of the living God - the statement of faith that Christ uses to build His church, the statement that places everyone who confesses it as a living stone into this growing temple.
I John 5:1, Whosoever believeth that Jesus is the Christ is born of God. That’s the rock that builds the church.
I John 4:15, Whosoever shall confess that Jesus is the Son of God, God dwelleth in him, and he in God. That’s the rock that builds the church.
John 6:69, we believe and are sure that thou art that Christ, the Son of the living God. The rock that builds the church.
Acts 8:37, I believe that Jesus Christ is the Son of God. The rock…well, you get the idea.
Now, back to your question. What did Jesus mean immediately after that scene when he tells Peter, I give you the keys to the kingdom of heaven - what you bind (or loose) on earth is bound (or loosed) in heaven?
The key to whether anyone’s sins are bound or loosed is whether they confess Jesus as the Christ, the Son of God or not. When Peter preached at Pentecost, he could say to all those thousands who believed Jesus was the Christ that their sins were forgiven based upon their confession of faith.
When he laid hands on the Samaritans in chapter 8, he could tell them based on the genuiness of their confession whether their sins were loosed or not.
When he preached to Cornelius and his crowd in Acts 10, he could tell those who confessed Jesus as the Christ that their sins were forgiven. Those were the three key times when Peter opened the gospel up to the Jews, the Samaritans and the Gentiles.
But @Danageze - that wasn’t just a power that was given to Peter alone. You can tell someone who confesses that Jesus is the Christ, the Son of the living God, that their sins are forgiven! Every Christian can tell a new believer that. Because every one of God’s Christians are priests. And I do not mean that figuratively at all - it is literally true. If your salvation rests upon Christ, the Son of God, then you are more a priest than anyone ordained as one who doesn’t rest his salvation upon that rock.
I hope these thoughts help you. Let me know if you have any questions.