"Then" locates something in time or in a sequence. Generally, if you can substitute "(at) that time" or "subsequently" in the sentence, then the word to use is "then."
We'll see you then.
In the recipe, beat the butter and sugar first and then add the eggs.
Dolley Madison, then First Lady, fled the White House when the British invaded Washington in 1814.
The word "then" is also used in hypothetical statements in combination with the word "if." Example: If you have problems doing the homework, then you can ask questions tomorrow in class.
In contrast, the word "than" has nothing to do with time. It is used instead to make comparisons.
The commute to her new job is longer than her last commute.
Other than the occasional mystery, he reads nonfiction.
I enjoy hiking more than jogging.
The table below outlines when to use "then" and "than."