Three basic elements that make or break a painting

What defines great art? It’s not style or beauty.

Execution, 1996, Yue Minjun, courtesy of the artist
Emotional content
Stirring a response in the viewer is the first responsibility of art. This is done by evoking ideas, memories, or a sense of place. (Even bad paintings, if they’re of someone we cherish, can be meaningful to us.) Painting is primarily a medium of communication. If there’s no content, there’s no point. If the viewer doesn’t stop and ponder, the artist has failed at his primary job.
Style has nothing to do with this. Photorealism or abstraction can make points every bit as powerful as figurative painting does. That is a question of the personal taste of the artist and his audience, nothing more.
Likewise, emotional content has nothing to do with beauty, or the lack of it. There is nothing beautiful in Execution, a 1996 painting by Chinese artist Yue Minjun. It was inspired by the Tiananmen Square Massacre and it packs a raw emotional punch. Conversely, Berthe Morisot with a Bouquet of Violets, by Édouard Manet is a lovely painting of an obviously-revered woman. It has just as much emotional content as Yue Minjun’s painting, but in a completely different way.
In some ways, simple thinking is a virtue in painting. Too many ideas, too much conflicting emotion, and the piece will be too complicated to say much at all.
Berthe Morisot with a Bouquet of Violets, 1872, by Édouard Manet, courtesy MusĂ©e d’Orsay
In painting classes, we focus on technique, because it’s the basis of painting. Technique simply refers to the protocol of producing a competent painting:  mark-making, composition, palette, building up a surface, moving the viewer through the piece, etc.
In certain fashionable circles today, technique gets a bad rap. Art has become more about making social statements and less about skill. That only works as long as the artist colors within the lines of his particular social statement. 
Imagine, if you will, that an enfant terrible artist comes across a moment of great beauty or a harrowing personal tragedy that requires great skills to depict. He is lost. Technique frees us to be emotionally responsive, but emotionalism cannot be sustained into maturity without a basis in technique. Without it, we have inchoate noise.
Ophelia, 1852, John Everett Millais, courtesy Tate Museum

It’s an interesting fact that we identify works of art by their creator’s names; we ask, is this a Caravaggio or a Gentileschi? Once living, complicated humans, artists are transformed into the sum of their work.
To be great, a painting must transcend the symbols and customs of its times. John Everett Millais’Ophelia (c. 1851) is in many ways a Victorian trope. To completely understand it, you’d have to be familiar with Shakespeare’s Hamlet and with the Victorian idea of the language of flowers, for the flowers in Ophelia’s garland all have specific meaning. Most modern viewers know neither, and yet the painting can still move us, because of the profundity of Millais’ understanding of despair.