"We live in a submarine(,) which is painted yellow."
That depends on whether you use the comma or not. It may be confusing that the relative clause is at the end, making it look optional.
- We live in a submarine, which is painted yellow.
With the comma, there's one submarine that just happens to be painted yellow. If you remove the relative clause you still know what submarine is meant; the paint is supplementary.
- We live in a submarine which is painted yellow.
Without the comma, you can imagine the submarine is one of many. The paint now identifies the submarine. If you remove the relative clause you don't know what submarine is meant anymore; the paint is not supplementary.
Also: in restrictive relative clauses you can replace which by that; in non-restrictive ones you can't.
Where I learned this: