When is an Ambiguous Ending for a Novel Justified?

Ambiguous endings are one of the most controversial elements a writer can include in a novel. When are they justified, and when do they fail?