There are several ways of asking a person's name, depending on who that person is.
您貴姓﹖
This is a very polite way of asking someone's name, literally "What is your honourable surname?". It is usually used to address one's elders or superiors, or someone of one's own age but to whom one wants to be polite. Notice, however, that the expression 貴姓 cannot be used when asking about a third person's name, or when referring to oneself.
A: 您/你貴姓﹖
What is your name?
B: 我姓丁。
My name is Ding.
你叫什麼﹖
This is a plain form of asking a person's name. It is usually used to address people of one's own age or younger, or one's inferiors. If one wants to be a bit polite, 請問 can be added to the question:
請問﹐你叫什麼﹖
May I ask, what's your name?
Unlike 貴姓, which is only used in the second person, 叫什麼 can be employed for all persons:
她叫什麼﹖我們叫什麼﹖我哥哥叫什麼﹖etc.
When asked 你姓什麼﹖you are supposed to give your last name first, and then as an option you can add your full name afterwards. But when asked 你叫什麼﹖you can give either your given name or your full name.