Once someone is validly baptized, Catholic or otherwise, he is baptized forever (CIC 845). One can never lose baptism or become “unbaptized,” although one might lose the benefits of baptism by personal sin. But as to whether someone baptized Catholic is thereafter always Catholic, that’s a slightly different question.
In most cases, the answer will be that someone baptized Catholic remains Catholic (see CIC 111, 205). But, by implication of canon 205–which requires, to be considered in full communion with the Church, a basic profession of the faith, some level of sacramental participation, and some degree of submission to ecclesiastical governance–one can imagine circumstances under which someone who was baptized Catholic might reject any or all of these elements to the point at which he could not be considered fully Catholic anymore, notwithstanding the fact that he remained baptized.
In support of this interpretation, keep in mind that the Code of Canon Law contains a norm that, although dealing with technical requirements related to marriage, has implications for your question. Canon 1117 requires that canonical form for marriage be observed by anyone baptized Catholic unless that person has “left the Church by a formal act of defection.” The 1983 Code does not define “formal act of defection,” but clearly the concept of leaving the Church, as opposed to simply lapsing in one’s faith or breaking the laws of the Church, exists in canon law and has repercussions in Church life.
While what is really needed here is an “authentic interpretation” by Roman authorities as to what constitutes a formal act of defection, a few things seem clear: (1) merely marrying outside the Church does not by itself count as a formal act of defection, and such a person would still be considered Catholic under canon law (albeit perhaps a “bad” Catholic and certainly one in an invalid marriage); (2) mere attendance at the services of another denomination, even if over a long period of time, does not constitute a formal act of defection from the Church; and (3) the failure to practice one’s Catholic faith, even over a long period of time, does not constitute a formal act of defection.
That said, it is generally accepted that formal registration in another denomination, especially when coupled with support or work for that denomination and extended participation in its religious services, does constitute a formal act of defection from the Catholic Church. For that matter, a public declaration of defection from the Church, under otherwise credible circumstances, might well constitute a formal act of defection, since registration in another denomination is not strictly required for defection to take place. In any case, though, since Catholic baptism establishes a canonical presumption of Catholic affiliation, canonical proof of defection from the Church must be produced to overcome that presumption.
Finally, as to how one can come back into the Church, canon law does not specify a procedure to be used. The “abjuration of errors” formerly required by canon law under certain situations similar to the one you describe (1917 CIC 2314) has not been carried over in the 1983 Code. Therefore, I think that sacramental confession is generally the best route to follow. If there had been some public act (say, a letter to one’s bishop) by which one’s formal defection was accomplished, I think it prudent to repudiate such an act in the same or a similar public manner so as to remove any lingering doubts about one’s ecclesiastical status.
All of this deals with one’s juridic (legal) status as a Catholic. It does not deal with other forms of union one may have with the Catholic Church, such as the moral obligations one has toward the Church, even when one is in rebellion against it. The Code itself acknowledges the existence of certain continuing legal obligations to the Church, even after a formal defection. Canon 11 states that ecclesiastical laws bind those baptized or received into the Catholic Church, but the Code nowhere makes express provision for the corresponding legal obligations to be obviated when a person defects from the Church (except in a few cases, such as observing the Catholic form of marriage). Thus, for example, a priest who formally has defected from the Church is still bound by his vow of celibacy.