1. Who is Jesus speaking to?
2. Who is to He telling do the forgiving?
3. Who is He saying should be forgiven?
In Luke 23, Jesus is speaking to God the Father, asking Him to forgive the executioners. This is not to say that Jesus expects that God the Father will forgive them without repentance, because it is the clear elsewhere in Scripture that God does not forgive the unrepentant (Luke 13:1-5). Rather, the answer to Jesus' prayer would be that the Holy Spirit would lead them to repentance, resulting in their forgiveness. We even see this prayer answered in part when the Soldier in the Gospel of Mark confesses "Surely this man was the Son of God" after Jesus has died.
Now, when speaking of Christians forgiving Christians in general, it is safe to state that we ought to forgive all sins, even those which are not repented (See Colossians 3:13). This is not to say that we maintain the same relationship with those who have unrepentedly sinned against us, or that we reconcile with them prior to their repentance, but that we release the right to avenge their sin into God's hands.
But, in the case of Luke 17, Jesus is speaking to the disciples, the Church's first pastors, regarding how they are to forgive. In John 20, Jesus tells them, "If you forgive anyone his sins, they have already been forgiven. If you do not forgive anyone his sins, they have already been retained." The way that the pastor deals with the sins brought to Him is different than the way Christians handle sins against one another. Because the pastor is charged with announcing God's forgiveness rather than merely his own, he does not forgive all sins when acting in his authority as pastor. Instead, he announces whatever God announces regarding sin. What this means is that pastors forgive sins when the one who confesses is repentant, and they refuse to announce forgiveness for as long as the one who has committed the sin refuses to repent.
Forgiveness works in different ways based on the vocation of those involved. While Christians are to forgive one another at all times, and Jesus, as God, certainly has the right to pray for the forgiveness of whomever He chooses; when pastors are acting in their office as the spiritual shepherd of the congregation, then they are called on some occasions to forgive and on others to retain sins, based on the repentance or lack thereof displayed by the sinner before them.