Relative Pronouns: que, quem, cujo, onde
European Portuguese uses que as the general relative pronoun, quem for people after a preposition, cujo/a for possession, and onde for location.
PortuStories Editorial
European Portuguese Grammar Guide
Que is the most common relative pronoun and refers to both people and things as subject or direct object.
O livro que comprei é muito interessante.
The book that I bought is very interesting.
A pessoa que telefonou era a minha chefe.
The person who called was my boss.
Quem is used for people when a preposition precedes the relative pronoun.
A professora de quem te falei chegou hoje.
The teacher I told you about arrived today.
de quem = of whom.
Cujo/cuja/cujos/cujas expresses possession and agrees with the noun it precedes, not with the antecedent.
O aluno cujo pai é médico foi estudar medicina.
The student whose father is a doctor went to study medicine.
Onde (where) functions as a relative pronoun when the antecedent is a place: "A cidade onde nasci" (The city where I was born).
From a PortuStories Story
O café onde nos encontrávamos todos os sábados fechou o mês passado.
The café where we used to meet every Saturday closed last month.