"Hi, I am János. What's your name?"
Translation:Szia, János vagyok. Hogy hívnak téged?
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.
Téged is the accusative case of te, i.e. informal singular 'you'. We use it as an indicator at a introduction. But you may leave it out. it's not necessary.
I used: "Szia, én János vagyok. Mi a neved?" And it seems to be ok...is it really?