Moffat-era Doctor Who gets a lot wrong about gender. “Susan the horse” in “A Town Called Mercy” is a great example of how badly it’s handled as a matter of course–let’s deliberately raise the existence of trans* people so that we can make a joke about how funny it is that they exist! While also suggesting that it’s a choice! (This Tumblr post covers it much better than I ever could.)
But very rarely, it gets something right. Susan’s chosen a name for herself, and it tells you quite a bit about her (which the Doctor deliberately ignores in calling her “him.”) That becomes important in “The Name of the Doctor”: “The name I chose is the Doctor. The name you choose, it’s like, it’s like a promise you make.”
A person’s real name is always the name they choose to be known by. Just because most people default to the name their parents picked doesn’t make that their real name. Just because the government may insist they use a particular name on forms doesn’t make that their real name. A person’s real name is the one they introduce themselves with.