To understand the use of "that" & "which" like the way you sentenced, you need to know about restrictive/nonrestrictive modifiers.
For example, the following two sentences are both correct. But conveys totally different meaning.
The cars that are expensive often get stolen.
The cars, which are expensive, often get stolen.
A restrictive modifier restricts the scope of the noun to a subset. This is where "that" comes into play. In the first statement, "The cars that are expensive often get stolen" it means only those cars that are expensive get stolen. Not all cars!
We are pointing out a subset of cars called "expensive cars".
A non-restrictive modifier adds more information to the noun. Even if you remove the modifier the core meaning stays the same. In our example, "The cars, which are expensive, often get stolen" it means all cars are expensive and they get stolen. And it also means all cars get stolen.
Both of the below statement means the same. But the first merely adds more information.
The cars, which are expensive, often get stolen.
The cars often get stolen.
Also a non-restrictive modifier needs to be set off from the noun it modifies by commas. Whereas restrictive modifier should not have any commas. This is also a prime differentiating factor.
The cars that are expensive often get stolen.
The cars, which are expensive, often get stolen.