I think it's not as important as it seems. Maybe if you're on the spot, but in general, you should save every single required reading you ever read, keep as many books as possible, etc, so that you can easily consult them whenever you need to. That way you can look them up when it actually matters.
Remembering people by their actions, the role they played etc, is so much more important than remembering their names. History is often misunderstood as simply knowing when stuff happened and the big names surrounding certain events, but it's much more important to know the intricacies of what happened and to remember the actors without being able to put a name to them from memory than simply to remember the exact names and dates of everything without having any of the broader context memorised.
The more you read and get invested into a topic, the more you'll remember names. But some you'll still forget. It's natural. The historians with seemingly photographic memories who can list off sources in the spot can do so because they've invested thousands of hours into the same topic, not because they have better memories than other people. Even they will forget names sometimes.
Just the other day I confused an important Indian politician with the name of a fake city from a videogame. It happens to us all. What's more important is that I knew what he did and said and the role he played, and that it was just a matter of an edit to fix it.