What is the difference between "where are you from" and "where do you come from"?
Are they the same? Are they used in the same situations or not?
When you see someone for the first time which one is better to ask?
"Where are you from" is more common (at least in U.S. English). In my opinion, this is the preferred option when meeting someone new.
The difference is a bit more emphasis on the verb "to be/are" instead of the action of "coming/being from" somewhere as is common in other languages. The meaning is identical though.
1) "Where are you from?" implies that you want to know what city/state/country they consider "home," and that you assume it's someplace other than where you are right now. This may be confusing, since where someone is "from" isn't necessarily where they live. It also can be embarrassing to assume, for example, that a person of a certain ethnic background must "come from" some other place. It might be a good idea to separate the idea of "what is your family/ethnic background?" from "where do you live right now?"
"Where are you from?"
"I'm originally from Oslo, Norway, but I live in Chicago."
2) "Where do you come from" sounds kind of awkward and outdated. I think this is because it includes the present-tense verb "do" in a question about a past-tense action (coming from somewhere). This is perfectly understandable and you can say this if you prefer - I'd still suggest the other way though.
"Where do you come from?"
"I come from a land beyond the sea, overrun by trolls and dragons!"
3) "Where did you come from" would be correct if you want to know "where were you immediately before you came to this location we're at right now?" This can also be used to express surprise at the person's sudden arrival or unexpected actions.
"Where did you come from?"
"I was next door, but now I'm here to rescue you!"
According to Google Ngrams, "Where do you come from" was more common until about 1970. American English seems to have used it first - it became more common there in about 1965, but not until about 1984 in British English.
"Where are you from?" is a general question about origin, heritage or nationality; where as, "Where do you come from?" is more specific used for geographic locations, city, specific address etc.
It's tempting to take the position that there are absolute interpretations to all utterances. However I'm inclined to see interpretation as a fluid process, where the interpretation of a question asked or answered takes on a rhetorical trajectory whereby the asker and respondent act and react in accordance with their interests at any given point in the interaction. The nature of the interaction can change during the verbal exchange. For example: Q: where do you come from? (thinks: they think I'm foreign) A: I come from Foreigner Street. Response: Q: 1.... No I mean originally? 2.,,, no I mean (thinks: he thinks I hate foreigners) where did you come here from today? (thinks: phew!) etc....