1. Whenever the clause begins with a "wh" word or "that", you can put the preposition at the end.
Who did you say it to?
The person that he said it to.
2. Relative clauses where the "that" is optional.
The person (that) I said it to.
The seat (that) I am sitting on.