A mulligan is the repetition of a stroke, without penalty, in an informal game of golf. Such play is contrary to the rules of golf, and would result in immediate disqualification from any tournament or club competition.
Between friends and acquaintances, however, the "rules" governing the taking of mulligans vary widely. Most commonly, it is often considered polite to offer your playing partner(s) a mulligan if they hit an especially poor shot from the first tee (e.g. out of bounds; into a water hazard; flat and low into the gorse bush twenty yards from the tee, etc.). Once successfully away from the first tee, the usual rules of golf apply.
Some people prefer to limit the number of mulligans allowed in a round (say three or five), whereas others might allow a maximum of one per hole. Some restrict them to tee shots only; others will allow a mulligan to be taken anywhere on the course.
In broader usage, the term mulligan has come to mean any opportunity to begin a process at status quo ante a given event.