帅哥/美女 to get attention of someone who isn't handsome/beautiful
It is just flattering talk. Most people like being flattered. 

Personally, I think this kind of talk only suitable for actual handsome people or people with ordinary faces. 

If a person is truly ugly, calling him "handsome" might sound like you are mocking him.

A similar example :

You can call anyone "kind Sir" either he is really kind or just a regular folk who doesn't break the law. However, if you call an amoral person who rips babies away from their mother  "kind Sir" , you are clearly mocking him.