Let's take a look at the former sentence first: "If I have to type then, I need to switch on my system." This sentence implies that if you have to type at a certain time in the future, then you have switch on your system.
Now, let's look at the latter sentence: "If I have to type, then I need to switch on my system." This is an example of a conditional statement. The sentence implies that in order to do something (in order to type), you have to do something else (switch on your system). Also, in this example, the phrase "If I have to type" serves as an introductory element, and therefore, the comma should be placed after "type."
Sentences in which the comma appears after "then" would be of the former type.