In general, use commas to set off clauses, phrases, or expressions that are introduced by "as explained", "as said", "as commented", "as declared", "as stated", or similar terms.
At the start of a sentence, use a comma after "if necessary", "if needed", "when required", "where needed", etc. Normally, we don't need a comma before "if necessary", "when needed", etc. in mid-sentence or at the end of the sentence.
If "until" or "till" comes at the start of the sentence, use a comma after the clause introduced by "until"—a clause is a group of words that contains a subject and a verb.
Abbreviations for academic degrees or titles that follow a name should be surrounded by commas. When preceding a name, however, the abbreviation (or title) must not be followed by a comma.
Enclose names between commas when speaking to someone directly (e.g., in dialogue). In general, do not use commas when talking about someone (instead of talking to someone).