Surname
Last Name, Family Name
noun, の adjective
A name written in letters is the surname. Back in the day your surname was the important name (it's your family name after all, and family was king back in the day). This is the name you'd write out in kanji... aka in letters. So, that's why this combination of kanji means "surname."
みょうじ
This is a jukugo word, which usually means on'yomi readings from the kanji. If you know the readings of your kanji you'll know how to read this as well.
Note that the 名 portion is the alternate reading, so adjust your thinking accordingly so you can get to みょう. Just imagine someone saying "more" with a funny accent. They say "myou" instead of "more". Imagine them saying they have myou people in their family than yours. Their surname is spread amongst myou people than yours.
さくらさんの名字は何といいますか。
What is Sakura’s last name?
コウイチの名字をおしえてくれたら、お礼にてつ人二十八号のフィギュアをあげるよ。
If you tell me Koichi's surname, I will give you a figure of Tetsujin 28 in return.
私の名字はあなたには絶対教えません。
I will never tell you my family name.