We frequently hear usages such as “your highness” or “her majesty” when referring to royalty, and “your honor” when referring to judges. These aren’t exactly titles per se, but is there a collective name for them?
I can think of a few others such as “your grace” and “his excellency”. What others are there, and how many?
Yep, the term for it is “style”. There’s tons of them; unsurprisingly, monarchies tend to have more of them - the UK has a very differentiated system of styles depending on what kind of peerage, office, knighthood or whatnot someone holds.
As far as the ones you mention go, “His/Her/Your Majesty” is reserved for the ruling monarch, the ruling monarch’s wife in case the monarch is a King (but not the other way around - Prince Philip is not a Majesty), or people who have held such a rule in the past but retained the style (for instance, the Queen Mother retained the style “Her Majesty”, which she held by virtue of having been married to King George VI, for life, even after her daughter acceded to the throne). The other members of the royal family are “Their Royal Highnesses”. “Your/His/Her Grace” is used to refer to a duke - other peers are “lordships” (or, in direct address, “My Lord/My Lady”. “His/Her/Your Excellency” is used for the heads of state or government in republics, but nowadays mostly in diplomatic protocol (POTUS, for instance, is an Excellency in diplomatuic protocol), but also in other cases, e.g. ambassadors.
The Germans and Austrians had the most convoluted system. From “Your Imperial and Royal Majesty” for the Hapsburg emperor, down to “Your Well-Born” for a baron. Most of the weird ones you read about are English translations of French translations of German phrases. They usually sound better in German.
The British system is still quite convoluted to this day. It includes such subtleties as e.g. the distinction between “The Honourable” (for members of the House of Commons) and “The Right Honourable” (for members of the Privy Council, many of whom are also members of the House of Commons). In House of Commons debates, members are expected to use the correct style when referring to another member (which is always done in the third person, since MPs always address the Speaker of the House rather than the House itself in their speeches). Thus, there’s a difference if another MP who may have interrupted your speech is referred to as “the honourable member” or “the right honourable member”. In addition, there’s a tradition of replacing “member” with “friend” if the other person is of the same party as you.