Post hoc ergo propter hoc

Post hoc ergo propter hoc, Latin for "after this, therefore because of this", is a logical fallacy which assumes or asserts that if one event happens after another, then the first must be the cause of the second. It is often shortened to simply post hoc and is also sometimes referred to as false cause or coincidental correlation. It is subtly different from the fallacy cum hoc ergo propter hoc, in which the chronological ordering of a correlation is insignificant.

Post hoc is a particularly tempting error because temporal sequence appears to be integral to causality. The fallacy lies in coming to a conclusion based solely on the order of events, rather than taking into account other factors that might rule out the connection. Most familiarly, many superstitious beliefs and magical thinking arise from this fallacy.

Pattern
The form of the post hoc fallacy can be expressed as follows:
 * A occurred, then B occurred.
 * Therefore, A caused B.

Examples
From Attacking Faulty Reasoning by T. Edward Damer, Third Edition p. 131:

From With Good Reason by S. Morris Engel, Fifth Edition p. 165: