As examples which ones correct of following ?
- The town I was born in had a tree.
- The town that I was born in had a tree ?
- The town which I was born in had a tree ?
They are all correct. First, let me explain when to use "that" and when to use "which". "which" can be used when you want to give some extra information about the thing it refers to when the information is not necessary, whereas "that" is used when the information is needed to clarify or specify. See http://www.writersdigest.com/online-editor/which-vs-that.
Let's now talk about the 1) that omits the word "that". It is correct because sometimes people can to omit the word "that" out of the sentence but the sentence will still remain its meaning. It is fine. See https://www.quickanddirtytips.com/education/grammar/when-to-delete-that