It is typical to set off introductory adverb clauses with a comma. When adverb clauses conclude a sentence, however, they are not set off by commas if they restrict the meaning of the earlier part of the sentence.
Essential adverb clauses
Adverb clauses beginning with after, as soon as, before, because, if, since, unless, until, and when are usually essential.
In each case, the adverb clause provides essential information that changes the meaning (restricts) the informtion in the independent clause.
Nonessential adverb clauses
When a concluding adverb clause is nonessential, it should be preceded by a comma. Clauses beginning with although, even though, though, and whereas are usually nonessential.
Exercises:
Misuses of the comma 1
Misuses of the comma 2
Related topics:
Comma with introductory adverb clauses
Adverb clauses