Wall of text incoming.
It depends on the culture I want a story to have. Right now, I'm making a medieval Japanese game, so all of my characters have Japanese names. Basically, for the main characters I would use Japanese for something relating to them. Example, my main character's name is Rikuto (earth person in Japanese) because he has earth abilities. The thing is though, it's not as easy to judge because it's not a name commonly used for people with earth abilities. For unimportant people, I name them for what they are. For example, I just named a character "the Priestess" because her name isn't really important. For NPC's I need names for, usually the knights, I search up names from Medieval times to see what they mean, then translate them into Japanese. Example, I have a knight who is supposed to be Galahad, so I searched up what that means, found out that it means "pure" and then pulled out Google Translate, to get it into Japanese.
As for other races, that also depends on the setting. The elves in my game are not that important, as you only see them once, so not many will have names. I do, however, have some Neko's, but I name them based on what they look like. I put a lot of thought into names, and sometimes I admittedly get carried away, but people appreciate them most of the time.
As for last names, I either do the same as first names, or I find whatever flows. Sometimes, though, my names are so... out there... that I don't use last names because nothing fits. Example, none of the characters in my book have last names. Because, 1. I didn't see a point. 2. They're mostly names from a language I made up, so I can't have some characters with last names and others without.