Is there a rule, which states that one must or must not use comma before "then" in a sentence like this:
If you can read this, then you might want to answer this question.
Use comma in that sentence.
This is the general recommendation for sentences with a dependent clause followed by an independent clause. In your sentence:
Dependent clause: If you can read this
Independent clause: [then] you might want to answer this question.
From the Wikipedia page on Commas:
In English, a comma is generally used to separate a dependent clause from the independent clause if the dependent clause comes first: After I brushed the cat, I lint-rollered my clothes. (Compare I lint-rollered my clothes after I brushed the cat.)
Note that it doesn't mean that it is wrong to not use comma in this case. As noted by the same page:
While many style guides call for commas, many authors omit them, particularly with short sentences.
I didn't find some official rule, but, from this thread, if you are:
, then you need a comma.
If you can read this, then you might want to answer this question.
(sequence)"Sir, ssshh -- there's no talking in the library."
"Oh. I'll be quiet, then."
(or) "Oh. Then, I'll be quiet."
(consequence)
Basically, apart from "then" as "an indication of time", a comma should be used in front of it.
"I am going to the library to find that book. I will read it then"
Other usages are mentioned in this thread:
As a filler, comma before and after:
Well, then, what do you propose we do?
The answer, that you should use a comma in this sentence, comes from the use of "if." In fact, with the use of "if" you don't even need "then."
If you can read this, you might want to answer this question.
The comma here is required, and correct, because of the dependent clause "If you can read this." The word "then" is an adverb that just happens to appear after the comma that was triggered by the use of "If."
Now, if you did not have a dependent clause triggering the need for a comma, you would not insert a comma before "then." For example:
I picked up my paycheck then paid my bills.
This is why many people almost instinctively add "and" before "then" to allow the use of a comma between two independent clauses. For example:
I picked up my paycheck, and then I started to pay my bills.
A comma is necessary in a compound sentence. When there is a subject and a predicate on both sides of the conjunction. Examples: I clean the rooms on Thursday, and I rake the garden on Friday. I clean the rooms on Thursday and rake the garden on Friday. There is no comma in the second sentence because it lacks a subject for the second part of the sentence. The verbs "clean" and "rake" share the subject, "I."