Jesus, speaking to Peter:
Matthew 16:19 And I will give unto thee the keys of the kingdom of heaven: and whatsoever thou shalt bind on earth shall be bound in heaven: and whatsoever thou shalt loose on earth shall be loosed in heaven.
Jesus, speaking to his disciples:
Matthew 18:18 Verily I say unto you, Whatsoever ye shall bind on earth shall be bound in heaven: and whatsoever ye shall loose on earth shall be loosed in heaven.
Jesus, speaking to his disciples after his resurrection:
John 20:23 Whose soever sins ye remit, they are remitted unto them; and whose soever sins ye retain, they are retained.
At Pentecost, the apostles received the Holy Spirit and thus had power over the church.
They had the keys to the kingdom of heaven in that they preached the gospel, and baptised believers.
They had the power to excommunicate those baptised believers who continued in sin.
Paul (who was also given the Holy Spirit) exercised this power.
1 Timothy 1:20 Of whom is Hymenaeus and Alexander; whom I have delivered unto Satan, that they may learn not to blaspheme.
There is no one authorised with the Holy Spirit to exercise this power today.
I hope you find this helpful.