"您贵姓？" is truly used in daily life to show your respect for someone.
If you want to know what someone's surname is, you can ask"你姓什么？"directly. For example,a teacher meets a student for the first time, maybe he will ask the student"你姓什么？". However, just like Henry Alejandro said, in Starbucks,waiters should behave politely and show their respect to customers, so he said"您贵姓？".
We can also say "请问您贵姓？“to stress your respect and politeness.