Catholics can’t technically leave as baptism is believed to leave a mark on one’s soul. That's not correct.
In 1943, Bl. Pius XII released the encyclical Mystici Corporis, in which he articulated membership in the Catholic Church this way:
"Actually only those are to be included as members of the Church who have been baptized and profess the true Faith, and who have not been so unfortunate as to separate themselves from the unity of the body, or been excluded by legitimate authority for grave faults committed"
You would still carry the indelible marks on your soul of baptism and confirmation , but you would no longer be a member of the Church and thus not a Catholic.
Certainly, the person himself might no longer identify as a Catholic. For example, if a person decided to reject the dogmas that the Church has defined and joined a Protestant church, he would no longer consider himself a Catholic, but a Protestant.
Ceasing to identify as a Catholic would be even more obvious in the case of an apostate, for to commit apostasy, one must entirely renounce Christianity and be willing to say, “I am no longer a Christian.”
Please do not spread misinformation.