.
Points to remember:
You preface asking a question with 请问 to be polite.
Use 你叫什么名字? for people younger than you, and 您贵姓? for those of the same age or older.
Remember that 叫 is for the first name and 姓 is for the last name (surname).
Depending on context, 名字 could refer to your full name or just your first name.
您 replaces 你 when you want to show respect towards the person you are talking to (usually for someone older or of higher social status).
The 贵姓 also shows respect for the person you are talking to as opposed to 你的姓是?
When answering the question 你贵姓? you wouldn’t answer with 我贵姓 as such respect is reserved for others and not for you.
Using titles such as 先生 and 小姐 when referring to someone conveys respect to them.
Use 你几岁? only to ask the age of much younger people.
Culture Note:
Names: Unlike English, Chinese full names are read last name first. Last names are usually one character and first names are usually two characters. So most Chinese names have three characters in total. You usually wouldn’t ask someone their name right at the beginning. It’s normal to make some small talk first before asking someone for their name. If you don’t know someone’s name it’s perfectly okay to just call them by their title. For example at a restaurant, you can address your waitress as 小姐 or your waiter as 生生.
Also, only very close friends are on a first name basis. Chinese are very sensitive to age and social status so this needs to be respected. So in general use a last name and a title like 王先生. If addressing someone younger (or of a lower social status) than you, use the full name (note last name first).