Give them memorable names that suggest something about who they are or what they want.
Bonus points if the names are hilarious.
The name tip above will help with remembering NPCS as noted.
For coming up with them on the fly, there are a ton of random NPC generators on the internet. Or do what I do: Enlist your players' help in fleshing out an NPC. Recently, the PCs in my game agreed to go clear a road of a blockade by hobgoblins so that the NPCs could send messengers to the lands to the north to request reinforcements ahead of a major conflict. The players asked to have the messenger go with them so they could clear the road and send the guy on this way. This would save time, they figured, and save the NPCs a few precious days to get word back.
I didn't anticipate that, but it was reasonable, so I told them the NPCs gladly send a messenger with them. I then asked for some details on this guy directly from the players. They told me his name was Redshirt. I added his first name, Gunnar. And thus, Gunnar Redshirt was born. With that name, they basically told me that they think this guy is pretty much going to die. That gave me some direction to go in with the NPC's mannerisms and characteristics (naive about his certain mortality). In addition to remembering the guy, I had player buy-in on both the NPC and his predictable death plus whatever complications may arise from that event.
Now, some players don't like this. They don't want to collaborate in this particular way, believing the DM's role is to handle this sort of thing. So if you try it, be prepared for some blank stares or objections. But if your players are anything like mine or the many fine folks I've played with in pick-up groups, they'll jump on the opportunity to see their ideas included in the game in this manner.