There's a parallel in Luke 24:36ff. I think 47 is for the whole church, not just the disciples.
In john it's less clear, but I'd assume the same.
What does it mean, and how close is it to something Jesus said?
The obvious meaning is church discipline. If it were Matthew, I'd say that's obviously the meaning. But that's not so emphasized in John. John sees whether or not we have faith as placing us as Christ's follower or condemning us. This passage connects it with the Holy Spirit. It's at least possible that through the Gospel and baptism, the Church brings the Holy Spirit to people. If they believe, then their sins are forgiven. If not, they are retained. This has the advantage of being essentially the same as the charge in Luke 24:47.
I'm sure people are aware that commentators vary on the meaning. There's some tradition with connecting it to admission to baptism, though the commentators I consulted don't think that's what John meant (nor do I). Some also connect it with Church discipline, but not everyone. At a minimum it means that the Church brings Christ to people, and if they have faith, their sins are forgiven.