§1. A party can freely appoint an advocate and procurator; except for the cases established in §§2 and 3, however, the party can also petition and respond personally unless the judge has decided that the services of a procurator or advocate are necessary.
§2. In a penal trial, the accused must always have an advocate either appointed personally or assigned by the judge.
§3. In a contentious trial which involves minors or in a trial which affects the public good, with the exception of marriage cases, the judge is to appoint ex officio a defender for a party who does not have one.
Source: Code of Canon Law (Vatican.va)