"Hi, I am János. What's your name?"
Translation:Szia, János vagyok. Hogy hívnak?
The phrase Hogy hívnak téged? that is used for "What's your name?" translates literally as "How do they call you?", and téged is the "you." It can be left out, as long as you expect the other person would understand from context who you're asking about.
"What's my name?" would be expressed as "How do they call me?" which is Hogy hívnak engem? You could also drop the engem from that sentence if it's clear from context who you're asking about.
But that means the short phrase Hogy hívnak? could mean ...me or ...you. And so sometimes it is nice (or important) to include the objects for clarity.
'Én vagyok János' kinda has a different emphasis.
It still means 'I am János' but more like if for example there were 2 boys in a room and you pointed at one of them and said 'gyere ide János - come here János' but the boy you pointed at was actaully called József. Then József would say 'én Józsi vagyok - I'm Józsi' and then János would step forward and say 'én vagyok Jani - I'm Jani'.
I'm sorry if that was confusing, it's difficult to explain things when they're technically correct but you don't use them that way, especially when the English translation is the same exact thing.
So basically 'én vagyok' is used when talking about yourself.