You can use both of them in the same way, "Me llamo John" is literaly "I call me John" but the correct translation is "My name is John". On the other hand, "Mi nombre es John" is literaly "My name is John", and is totally correct to use it like "Me llamo". You have to notice one thing: you have to write "Me llamo" because "Mi llamo" doesn't exist.