"Each" — pronoun or adverb
Each is a Quantifier, a part of speech that wasn't discovered until the 19th century, too late to get into the Top Eight list, which was canonized much earlier. Quantifiers are a form of Determiner (another POS), and they "bind" noun phrases, which means they modify and quantify them. Like most noun modifiers, quantifiers are naturally found before the noun they modify.
Like many quantifiers, however, each is subject to a syntactic rule called "Quantifier Shift" (aka "Quantifier-Float" or "Q-Float"), which moves a quantifier from a prenominal position to an adverbial position:
- Each of the boys said they would go. == Q-Float ==> The boys each said they would go.
Q-Float applies to the quantifier all as well as each, but not to the quantifier every:
- All the boys said they would go. == Q-Float ==> The boys all said they would go.
- Every boy said he would go. == Q-Float ==> *The boy(s) every said he/they would go.
As to the question...
In the first sentence in the question, that each have 4 strokes is a relative clause modifying letters, with that as the subject relative marker, and a Q-Floated each.
In the second sentence, each has 4 strokes is half of a compound sentence, a main clause with each as its subject.
Each (and, again, all, but not every) can act as a pronoun substituting for (in this case) each letter, in the same way this can substitute for this letter.
In example B) 'each' is the subject of the clause and therefore acts as a pronoun and governs the verb in third person singular.
In A) 'each' acts as an apposition to the subject of the relative clause 'that'. Even though some authorities (e.g. the OED) still call it a pronoun in this function, the verb in the clause is governed by 'that', and must therefore be a plural form.