A relative clause is a type of subordinate clause that gives more information about a noun. It usually begins with a relative pronoun.
The girl who won the competition performed a dance routine.
The phone that Jess is buying is the latest model.
Sometimes the relative pronoun can be left out of the sentence.
The phone Jess is buying is the latest model.
In this sentence the phone is the object of the sentence (Jess is the subject as she is doing the buying). Notice that the pronoun can't be left out when it refers to the subject. In the first sentence the girl is the subject of the sentence as she is performing the routine, so the sentence wouldn't make sense without the pronoun.
It can also be tricky to know whether to put commas around a relative clause or not. Look at the following sentences.
The dog that came first at Crufts was the most beautiful.
The dog, which was very sweet, was called Muffin.
If you can leave the relative clause out of the sentence and it still makes sense, then use commas. If we take the relative clause out of the second example we still have a meaningful sentence.
The dog was called Muffin.
However, the first sentence is comparing the dog with all the other dogs at Crufts, so if we take the relative clause out of the first sentence it changes it completely.
The dog was the most beautiful.
So you need to decide whether the relative clause is essential to the meaning of the sentence or not. If it just adds extra information but can be left out, then use commas.