This depends on the context.
In person in a small group, you'd say "Hi! I'm James!" and probably extend your hand to shake.
If you are in front a of a room of strangers introducing yourself, you might be more formal, with "My name is James".
However, if you're joining a conference call, you'd say "Hi! This is James." That's because you expect that the people you are talking to probably know who you are, or at least could look at the list of invitees, but they don't necessarily know that this voice is yours.
"Hello, this is James" was also a common way for someone named James to answer the phone, back in the days when phones were more tied to a location than individual devices as mobiles are today.