The simple way to ask someone's name is to say, "What is your name?"
If you are concerned that a question -- any question -- is abrupt or potentially rude, you can soften it by saying, "Excuse me, but ..." or "Would you please tell me ..." or "Would you mind telling me ...".
In your examples, "May I ask you what your name is?" is valid. "May I ask you what's your name?" is awkward; a fluent speaker wouldn't say that. Well, someone might say that in informal speech, but you wouldn't write it or use it in formal speech. Use of contractions gets tricky some times. Usually you can only use a contraction when it can be expanded in place. Here, you wouldn't say, "May I ask you what is your name?" Though we break this rule for questions sometimes. It's okay to say, "Don't you like apricots?", meaning, "Do you not like apricots?" But no fluent speaker would say, "Do not you like apricots?".
You can ask, "Could you tell me where you are from?" Note "where you are" not "where are you". "Could you tell me where you're from?" is fine, because the contraction expands in place.
Perhaps your uncertainty is with the wording of "indirect" questions like this.
"Where are you from?"
"Can you tell me where you are from?"
Note the order of the subject and verb changes, from "are you" to "you are". In general in English, a statement is written subject - verb - object. Questions that you "is" or "are" are generally is/are - subject - verb or is/are - subject - adjective. Like "Is Bob going?" or "Is Bob tall?" Questions that use an interrogative word like who, how, why, what, or where are generally interrogative - is/are - subject - object or interrogative is/are - subject - infintive verb. Like, "Who are Bob's friends?" or "Where is Bob going?" With do/does it become interrogative - do/does - subject - verb. Like, "What does Bob eat?" or "How does Bob think?"