The phrase hear! hear! originated as the imperative hear him! (hear him!) in the late seventeenth century, or possibly earlier. It became popular as a British parliamentary exclamation used to draw attention to something a speaker had just said. By the late eighteenth century an abridged version had developed: hear! or hear! hear! In its written form it is punctuated in various ways, e.g. hear, hear and hear hear!
Over time, the expression spread to other domains, such as meetings and local debates. These days it is often used online to signify agreement, in much the same way that “Seconded”, “What [x] said” and “+1” do. It can, however, be used to convey anything from enthusiastic approval to withering derision, depending on the tone and context of delivery. Deployed ironically, it would be similar to “Would you listen to that!” or “Get him/her!”, which in text form might require a sarcastic font to prevent literal interpretation.
Hear! Hear! is frequently written here! here! (or here, here!, etc.). In A Dictionary of True Etymologies, Adrian Room suggests that this may be as if to indicate “the person or place where there is approval (while also suggesting the almost synonymous ‘same here!’)”. Another factor in the confusion may be the historical predominance of the phrase as a spoken expression rather than a written one. If Google hits are any indication, the erroneous rendering now seems more popular, and may ultimately become the normal or even standard form, through contagion and imitation.
Turning in the other temporal direction, the same expression – more or less – appears in the Bible, albeit in the slightly different sense of “Listen” or “Hear me”:
Then cried a wise woman out of the city, Hear, hear; say, I pray you, unto Jo’ab, Come near hither, that I may speak with thee.
A hear, hear or hear-hear is the noun describing the act of saying “hear! hear!”, while to hear-hear is the verb. A person who says “hear, hear!” can be described as a hear-hearer. If you have difficulty remembering whether it’s hear, hear! or here, here!, it might help to recall the origin of the phrase.