How was the thief on the cross saved? He had only faith. He was not baptized. He had didn't have many good works. How then was he saved?
1) The death of the thief occurred in the Old Covenant, not the New Covenant (i.e. Christ hadn't risen from the dead yet when this episode took place - the sacrament of Trinitarian baptism had not yet been instituted. The sacrament of Holy Baptism occurred forty days later at the ascension of Christ..."Go therefore into all the world...baptizing in the name of the Father...").
2) even so, the Catholic Church teaches that God has bound himself to the sacraments, but He Himself is not bound by the sacraments. In other words, God can do what he wants. He can save people in extraordinary ways.
The sacraments are real signs that unite us to the passion and death of Christ. The thief was literally in and at the passion and death of Christ. Our baptism places us in the same place as that thief - crucified with Christ. Even if sacramental baptism was available to the thief, it would have almost been redundant since he was literally crucified with Christ and at the same time placing his faith in Him. He is the quintessential believer - helpless and completely dependent upon the Lord's mercy.