Here’s a rule:
Semicolons separate independent clauses.
Commas separate parts of a sentence.
An independent clause is a sentence that happens to be attached to another sentence. An independent clause has its own subject and verb, and could stand alone. In fact, the decision as to whether to make something a stand-alone sentence or an independent clause is often a matter of preference—the choice can affect the tone of the writing, but both choices are grammatical.
Here’s a sentence that gets it wrong:
A transition is a one-way link, if an issue moves back and forth between two statuses; two transitions should be created.
That comma should be a semicolon. Even a period would work. And that semicolon should be a comma. The “if…” part goes with what follows; it’s a dependent clause (called a protasis, if you want to know the technical term). So here’s what the sentence should look like:
A transition is a one-way link; if an issue moves back and forth between two statuses, two transitions should be created.
Feels better now, doesn’t it?