What is the name for the long dashes that sometimes replace the inner letters of a name in older printed texts, and what is their purpose?
As plainclothes has said, the dash is composed of several em-dashes. One might call it a long dash...
Dickinson is best known for writing brief poems, often untitled, consisting of short lines peppered with long dashes, which mark her out as a more modern voice among her contemporary 19th-century poets. [Daily Telegraph]
...or perhaps an anonymisation dash, which makes it clear it blanks out most of a name and gives more indication of its length than simply long.
The purpose is explained in the Wikipedia article linked to your image, Roman à clef: it's a crude anonymisation technique.
In the novel, the character called Horatio is identified with the actual Lord Peterborough; and Endymion is fairly obviously Lady Manchester, but it doesn't actually say that.
[This question is perhaps more suited to ELU.SE.]
Em dash. It takes up the full body width of the font.