The fundamental rule to using the comma is to…
Use a comma before a coordinating conjunction joining independent clauses.
When a coordinating conjunction connects two or more independent clauses—word groups that could stand alone as separate sentences—a comma must precede it. There are seven coordinating conjunctions in English: and, but, or, not, for, so, and yet.
Ex. Nearly everyone has heard of love at first sight, but I fell in love at first dance.
A comma tells readers that one independent clause has come to a close and that another is about to begin.
EXCEPTION: If the two independent clauses are short and there is no danger of misreading, the comma may be omitted.
Ex. The plan took off and we were on our way.
CAUTION: As a rule, do not use a comma to separate coordinate word groups that are not independent clauses.
Ex. A good money manager controls expenses X and invests surplus dollars to meet future needs.
The word group following and is an independent clause; it is in the second half of a compound predicate (what the subject is, does, seems, or has done to it).
Sources: The Bedford Handbook, The CUNY WriteSite (www.writesite.cuny.edu/grammar)