An epigram is a little poem or clever statement, but an epigraph is a specific kind of epigram: a witty statement that's inscribed somewhere, such as on a building or at the beginning of a chapter or book.
Epigrams are short and often catchy, and sometimes a little sassy. Wits like Dorothy Parker and Mark Twain were masters of the epigram:
The first thing I do in the morning is brush my teeth and sharpen my tongue. (Dorothy Parker)
Censorship is telling a man he can't eat steak because a baby can't chew it. (Mark Twain)
An epigraph is a kind of epigram, but it's written on an object, like a coin, a building, or a book. An epigraph often comes at the start of a novel or short story, and gives the reader a little hint about what's to come:
A good epigraph should be more than mere adornment. (Guardian)
The epigraph to Shelley's novel is the fallen Adam's complaint to God in Book X of Paradise Lost. (Independent)
"Stop! It is here, the empire of death,'' reads an epigraph from poet Jacques Delille that has marked the Catacombs' entrance since they opened to the public in the 19th century. (Globe)
An epigram is a funny little remark or poem — you could get one by telegram! But an epigraph reminds you of your graphite pencil, because it's always written down.