Apart from Christ and His Church there is no salvation. In Colossians 1:18 St. Paul affirms, "[H]e is the head of the body, the Church." The Catechism of the Catholic Church in paragraph 846 teaches, "[A]ll salvation comes from Christ the head through the Church which is his Body."
In John 15:5–6 Our Lord says, "I am the vine, you are the branches. … If anyone does not abide in me, he shall be cast outside as the branch and wither; and they shall gather them up and cast them into the fire, and they shall burn." Wherever there is salvation there is this true vine.
Denzinger 1677 quotes Pope Pius IX, who in his 1863 encyclical Quanto conficiamur moerore wrote,
It is known to Us and to you that they who labor in invincible ignorance of our most holy religion and who, zealously keeping the natural law and its precepts engraved in the hearts of all by God, and being ready to obey God, live an honest and upright life, can, by the operating power of divine light and grace, attain eternal life, since God … will by no means suffer anyone to be punished with eternal torment who has not the guilt of deliberate sin. But, the Catholic dogma that no one can be saved outside the Catholic Church is well known; and also that those who are obstinate toward the authority and definitions of the same Church, and who persistently separate themselves from the unity of the Church, and from the Roman Pontiff, the successor of Peter, to whom "the guardianship of the vine has been entrusted by the Savior," cannot obtain eternal salvation.
Vatican II repeats this admonition in paragraph 14 of Lumen Gentium: "Whosoever, therefore, knowing that the Catholic Church was made necessary by Christ, would refuse to enter or to remain in it, could not be saved. … [N]ot only shall they not be saved but they will be the more severely judged."
Find out what Catholics must do to be saved in episode 11 of Church Militant's Premium show, Baptize All Nations—Evangelization and Eternal Salvation.