There are so many words, depending on the context.
For someone who thinks they know more than those around them, we could say:
too pleased or satisfied about something you have achieved or something you know:
The look is sometimes described as...
"...looking like the cat that just got the canary"
People of God are often described in the Bible as "righteous men" (or women, of course), but those who feel they stand on firmer moral ground than others around them can be termed as:
believing that your ideas and behaviour are morally better than those of other people
This word is not necesarily limited to a religious context: so-called "Social Justice Warriors" also seem to fit into this category.
Synonyms for this adjective include...
sanctimonious, self-satisfied, smug, priggish, complacent, pious, moralizing, preachy, superior, hypocritical; informal goody-goody
But my favorite is "holier-than-thou", and for SNL fans, there is of course the Dana Carvey characterization of the "Church Lady". For those of us who grew up under the very heavy hand of such moralyzing and preachy parents, there is no more apt portrayal than that.