Repeating someones name in your head after you meet them so you remember it. Saying "I'm bad with names" is kind of just an excuse for something you can easily fix about yourself with practice.
That almost never works for me. If I see the person for 2/3 days in a row I'll probably remember the names, but there are people that I see only occasionally (in meetings or conferences) that I just can't remember their names.
One thing that can really help is addressing that person by their name while talking to them. Finishing off with "It was nice to meet you [name]" or working it in while you're talking to them. Saying their name to them and having them verify the response can help solidify it in your head. Also, if it's a name that's kind of complicated, maybe ask them how it's spelled.
I find that I remember better if someone introduces the other person to me