In some stories, you can be targeted by a curse provided the caster knows some things about you, one of which might be your real name. Death Note is a good, recent example of this. You can protect yourself against some class of evil spell by telling everyone a different, public name. Is there any mechanism or curse in 5th Edition for which you are better served by keeping your true name secret?
There are several spells which involve knowing the name of a person such as Legend Lore and Locate Creature, but for both of these descriptions of the person work just as well. The only 3 spells that I found involving a requirement to know the name of a creature are these:
Gate — “When you cast this spell, you can speak the name of a specific creature (a pseudonym, title, or nickname doesn't work). If that creature is on a plane other than the one you are on, the portal opens in the named creature's vicinity and draws the creature through it” (PHB p. 245).
Planar Ally — “If you know a specific creature's name, you can speak that name when you cast this spell to request that creature [to be sent to your aid by a being of cosmic power]” (PHB p. 266).
True Resurrection — “The spell can even provide a new body if the original no longer exists, in which case you must speak the creature's name” (PHB p. 285).
However, the only one of these spells that specifically denotes that pseudonyms, titles, or nicknames do not work is gate.
In conclusion — The only spell in the PHB which requires someone's true name is Gate. Whether or not the risk of someone (on a different plane from you) using Gate to summon you qualifies as incentive enough to conceal your true name is up to you. However, this is just what is in the handbooks, your DM is always free to add something involving true names into their campaign and if you like the idea maybe you suggest it to them!
The Gate spell requires a creature's true name in order to summon them.
When you cast this spell, you can speak the name of a specific creature (a pseudonym, title, or nickname doesn't work).
If you want it to be impossible for anyone (or anything) to arbitrarily summon you to other planes, you should keep your true name to yourself.