I read the book which is on the table. I visited the town which you told me about.
which – referring to a whole sentence
They were unsuccessful which is disappointing.
whom – used for object pronoun for people, especially in non-restrictive relative clauses (in restrictive relative clauses use who)
The boy whom you told me about got the best grades in mathematics.
that – subject or object pronoun for people, animals and things in restrictive relative clauses (who or which are also possible)
I like the vase that is over there.
where – referring to a place
The restaurant where I usually have dinner is nice.
when – referring to a time
There are times when I feel so lonely.
why – referring to a reason
This is why she refused the offer.
Subject Pronoun or Object Pronoun?
You can distinguish subject and object pronouns as follows:
If the relative pronoun is not followed by a noun or pronoun, it is a subject pronoun. Subject relative pronouns can never be omitted (dropped.) Example: The apple whichis lying on the table is sweet. The teacher wholives next door is nice.
If the relative pronoun is followed by a noun or pronoun, the relative pronoun is an object pronoun. Object relative pronouns can be omitted (dropped) in restrictive (defining) relative clauses. Example: The film (which)we watched yesterday was fantastic. The writer (who/whom) we met last weekend is very famous.