Chekhov's Gun is a writing principle, which states that any element introduced into a story must be useful. When introduced, the element may or may not be notable or even sensical, and will often become a turning point or 'missing puzzle piece' in the plotline. In this way it is similar to literary foreshadowing, but an emphasis is placed on removing all unnecessary elements from the story. Obviously, Chekhov's gun need not be an actual gun.
The principle is named after its creator, prolific short-story writer Anton Chekhov, who in a letter in 1889 wrote; "one must not put a loaded rifle on the stage if no one is thinking of firing it."
The opposite of Chekhov's Gun would be a Red Herring; an element introduced to divert attention away from other, more important action.
Comprehensive wiki TV Tropes describes J.K Rowling as having elevated this principle 'to an art form'. The particular example given is "the Snitch that Harry caught in his first ever Quidditch game. It appeared about halfway through the first book, was never even MENTIONED again until near the beginning of the last book. While it was around, its true purpose wasn't fulfilled until three chapters before the end of the entire book: It held the Resurrection Stone."