Topics, style, creativity, depth of thought and all such stuff aside, let us first understand the technical basics of a good sher.
A sher is a couplet, that is a two line (sentence, verse) poem. Each individual line is called a misra. Therefore, a sher has two misras, and can be a part of a ghazal, a nazm, or just be a standalone, and so on. Ghazal and Nazm are two forms of Urdu which are beyond the scope of this answer.
It is not necessary for the two verses to rhyme. Ideally, the first sher of a ghazal (matlaa) has both verses rhyming, and then the remaining don't have both rhyming. From a ghazal perspective, the rhyme establishes what are called the radeef and qaafiya. Let's take an example here:
Na thaa kuchh Khudaa thaa, kuchh na hotaa to Khudaa hotaa,
Duboyaa mujhko hone ne na main hotaa ko kyaa hotaa.
Huaa jab dard se behis to gham kyaa sar ke katne kaa,
Na hotaa gar judaa tan se to zaanon par dharaa hotaa.
Hui muddat ke Ghaalib mar gaya par yaad aataa hai,
Wo har ek baat par kahna ke yoon hota to kyaa hotaa.
(Written out of memory, maybe inaccurate in places)
Though not a typical ghazal by Ghalib, we can use this to understand what radeef and qafiya are, or what a ghazal is and what elements Urdu Poetry must contain.
Hotaa is the word that is repeated at the end of each sher (every set of two lines). This is called radeef, a word or a set of words repeated at the end of every sher. Khudaa, kyaa, and dharaa are the qaafiyas, the rhyming words that precede every instance of the radeef and give the rhyming effect to a ghazal. (Notice how the first two misras of the matlaa rhyme. The last sher, that contains the poet's name (takhallus) is called the maqtaa.)
Other important aspects are the wazan and bahr, which refers to the syllable scheme. Again, it's a very broad subject with about 19 recognised schemes of syllables generally used in Urdu poetry. The fundamental to be remembered here is that the number of syllables in both the misras of a sher, and in all shers of a ghazal have to be the same with the same pattern of stress, to ensure that it can be recited properly.
Not all ghazals follow this to t, and some poets alter words to create matching stress patterns, which is fine as long the flow in recital is maintained. Again, wazan refers to the same concept, but is different in its application. Suffice to say that together, they emphasize that a sher must have a consistent syllable and stress pattern. These are akin to metre in English poetry.
In a ghazal, a sher must complete an idea and not leave it dangling for the next sher to pick up.
For a nazm, the wazan and bahr, and also the sher-follows-sher pattern are not followed. Radeef and Qaafia have different applications in a nazm but are still utilised. Nazm is a different form of poetry that is not written for singing and hence doesn't have tarannum, or the sing-song pattern associated with ghazal. I am not dwelling on nazm here because a sher is not so technical in nazm.
For a standalone, Urdu poetry hardly supports any standalone shers. There are a few popular ones, but most of the other shers floating all over the web are only popular shers that are a part of a ghazal, a nazm, etc.
These aspects have to be followed for a good sher. Obviously, you need to be sure that you know the meaning of the word you are using and also get grammar and spellings correct. Again, morphology has to be known to ensure you can get the right wazan and bahr. Eloquence is likeable, because that will make a sher more pleasing to the ears. Thus, you could say grammar, or nahw, is mandatory; morphology, or sarf, is important, and eloquence, or balaghah, is desired.