Many people have to agree that a painting or a novel is wonderful, and they usually need to feel that way for years, in order for it to be considered a true masterpiece.
An artist or writer is generally capable of creating only one masterpiece in her lifetime, if she makes a masterpiece at all. When an art historian or English teacher uses it, the word masterpiece implies a truly sublime, amazing creation. You can also describe something that's simply great as a masterpiece, like the seven-layer chocolate cake your mom baked for your birthday. Masterpiece comes from the Dutch meesterstuk, "work by which a craftsman attains the rank of master."