Are both of them correct?:
1) "My name is John an yours?"
2) "My name is John, and yours?"
The first is ungrammatical.
The second is terse and unfriendly - even rude.
On meeting somebody new, say 'Hello, I'm John. How are you?'
If you say this in a friendly manner and with a smile, the other person will respond 'Hi, my name's Alphonse - nice to meet you'.