This punishment was laid down in Tudor times for those who successfully pleaded Benefit of Clergy, whereby members of the church found guilty of various felonies were spared the death sentence. In court, anyone could claim to be a member of the clergy; the test was reading out a passage from the Bible.
If they were successful (and many criminals with no clerical connections were!), they would then be ‘burnt in the hand’, meaning they were branded on the thumb. This was not always the only punishment; the sentence might also include imprisonment or transportation, for instance.
The main purpose of what in 18th‑century underworld slang was called being ‘badged’ or ‘lettered’ was to ensure malefactors could not claim Benefit of Clergy a second time. Sentence was carried out in the courtroom at the end of the session by a court official, or the local public hangman, using a red-hot iron bearing the letter ‘T’ for thief, ‘F’ for felon, or ‘M’ for murderer. Lancaster Castle still boasts a branding iron and the iron loops for holding the malefactor’s forearm in place.
It’s claimed that executioners were sometimes bribed to apply the iron cold, and that even judges themselves colluded in this if they were, for whatever reason, sympathetic towards the defendant. Branding died out in the late 18th century and was formally abolished in the 1820s.