This is a legal issue (since "punishments" are legal consequences), so we'll need to look at canon law.
When one leaves the Catholic Church, one may be rejecting the Christian Church and her teachings altogether, or (as seems more likely in the case you mention) simply rejecting certain of her truths and her ability to authoritatively speak the Truth. The former is technically known as apostasy; the latter may be either schism, heresy, or both. Canon 751 of the Code of Canon Law of the Latin Church states:
Heresy is the obstinate denial or obstinate doubt after the reception of baptism of some truth which is to be believed by divine and Catholic faith; apostasy is the total repudiation of the Christian faith; schism is the refusal of submission to the Supreme Pontiff or of communion with the members of the Church subject to him.
The distinction between heresy and schism is mostly that heresy requires "obstinacy"; that is, it requires that one be specifically told that a declared belief or doubt is contrary to Catholic doctrine, and then one must persist in that belief or doubt. Schism simply requires that one, in effect, believe that it's not necessary to follow the Pope and be part of the Church. For the remainder of this discussion, I'll assume that heresy is out of the question, and what is at issue is schism.
(Note: the noted canonist Dr. Edward Peters appears to agree that joining another church is a schismatic act; he refers to Rod Dreher's act of joining the Russian Orthodox Church, for example, as an act of schism.)
Formally speaking, one who commits an act of schism is subject to latae sententiae excommunication, that is, to being excommunicated without the act needing to be declared:
... an apostate from the faith, a heretic, or a schismatic incurs a latae sententiae excommunication.
It should go without saying that since a schismatic has voluntarily declared themselves no longer part of the Church, the Church may in turn declare the same thing—not that the individual will feel its effect immediately; but the hope is that if or when the person may return to the Catholic Church, they may feel the gravity of their action, in that they can't just "come back" but must first have their excommunication lifted.
However, it isn't that easy and straightforward. Canons 1321–1324 establish some pretty strict limitations on when excommunications and similar penalties may be imposed. Probably the strictest limitation of all is Canon 1323, section 2:
The following are not subject to a penalty when they have violated a law or precept: ... a person who without negligence was ignorant that he or she violated a law or precept; inadvertence and error are equivalent to ignorance.
If this is not specific enough, canon 1324 goes further, specifying in section 1 note 9 and section 3 that
a person who without negligence did not know that a penalty was attached to a law or precept ... is not bound by a latae sententiae penalty.
And since, indeed, most people are unaware of the punishment to be imposed by Canon 751, it is generally inapplicable (unless of course the violator is someone like a priest, bishop, or theologian, who certainly ought to be aware of this in particular).