chastity. This word (from the Latin castus, meaning "pure" or "chaste") refers to that part of the virtue of temperance that helps Christians achieve an integrated sexuality according to their state in life. Chastity, which is one of the fruits of the Holy Spirit, helps Christians abstain from sexual pleasure outside of marriage and fosters fidelity within marriage. (See CCC 2337-2359)
celibacy. this word (from the Latin caelebs, meaning "unmarried") refers to the state of those who have voluntarily chose to remain unmarried in order to devote their lives entirely to God and to the service of God's people. A vow of celibacy in ordinarily required of bishops and priests in the Latin Church, as well as for those entering into religious life. In the Eastern Churches, celibacy is required of bishops. (See CCC 1579-1580)
Source: Glossary of Theological Terms by Rev. John T. Ford, CSC, STD
When I was a young person I understood the meaning of chastity and considered it a desirable virtue. From school and family alike I learned that being chaste was something expected of me. It was a moral duty.
On closer examination of the definition of chastity one notices that it's a virtue for everyone, not only unmarried persons. This is so because it is about moderating one's sexual expression of love according to one's "state in life." So an unmarried person abstains from expressing love sexually, while a married person may express love sexually to one person only, his or her spouse. In the latter case chastity preserves fidelity between the spouses. Notice I used the word LOVE in the context of chastity and sexual expression. All of these belong together.
Celibacy is not synonymous with chastity. First of all, it's not for everyone. It is for those who voluntarily commit themselves to a single state in life for the sake of the Kingdom of God; moreover, to serve God. Vows of celibacy differ from vows of chastity, yet a celibate person is expected to live chastely.
This week a former Episcopalian priest was ordained as a Catholic priest for the Diocese of Buffalo in New York. Although he is not required to do so, this Fr. John Cornelius and his wife of many years have made a personal decision to refrain from sexual relations. Some news media have said he's taking a vow of celibacy. That's not what he's doing. He and his wife are taking vows of chastity. They are still both married, and that will not change.
For a more in-depth understanding of these words, you may look here.
For more on Fr. Cornelius, there is a good video interview here. This post has some good links, too, that shed more light on the meaning of chastity versus celibacy.