That has two forms: (A)Used as a relative pronoun (B) Used to introduce a noun clause.
Relative pronoun: who, whom, that, which, those, where, when
When 'that' is used as a relative pronoun, it modifies the word that precedes it.
Something like: I love the car that is too costly.
The above sentence comprises of two sentences: 1/ I love the car. 2/ The car is too costly.
You replaced the subject 'the car' and replaced it with relative pronoun 'that' and tagged it in the first sentence to arrive at: I love the car that is too costly.
Note: GMAT in its peculiarity differentiates between 'that' and 'which'. Use that when you use it as a restrictive relative clauses such as the one above, but use which in non-restrictive clauses such as I love my car, which is red.
That he swims daily is a great habit
Consists of two sentences: he swims daily and something is a great habit.
In the above sentence you have a noun clause: "he swims daily". You added that to it and added it to
something is a great habit to come up with: That he swims daily is a great habit
Note:GMAT doesn't like sentences beginning with that: In GMAT, expletive 'it' is added and the sentence will be something like: It is a great habit that he swims daily.
Let me know if you have any other questions.