You bet that it matters!
It is neither as important nor as damaging as a poorly written or flat story, but giving your characters the right name is certainly key.
I find it is rather like choosing a name for your child; the name has to suit the personality and it has to make sense for the time and, in some respects, the place. In fact, some countries have rules about what you can name your child, but that is another topic.
Of course, it should be memorable or represent something (be it a value or an idea) that defines your child - or your character, in this case. And if we are talking about fiction, the type of book you are writing also dictates how freely you may choose.
Although I had no difficulty choosing names for my children (luckily, my husband and I were on the same page there), selecting a name for each of my characters in my first novel has been grueling. Yes, that painful and difficult. The only name I settled on with relative ease was that of the main character. The rest? I may still change them.
That said, here are a few, common sense rules I read about that I have found helpful in tackling this task.
1. The name should match the era and the place
If you are writing historical fiction and your novel is set in 18th century Romania, Jennifer is obviously not the name to go with. Catalina or Constanta would be a better choice. On the other hand, if your novel is set in the future, somewhere far in space, Jennifer and, say, Fhyssia could work equally well.
2. The names of the cast of characters should, in the collective, make sense
Whether your novel has a large or a small cast of characters, the names should make sense collectively as well. You might not want every name to be short and snappy, of the same number of syllables or with the same places of emphasis. It might be boring to the reader and certainly easier to forget. Also, unless you have a good reason for it, vary the first initials. A family of five with Lilly, Lenny, Kelly, Pippi, and Patty, does sound rather mundane, does it not?
3. Think about the first and last (and middle, if any) names together - and pronounce them
Although the complete name of a character is not necessarily prominent throughout the work, you want to make sure it is realistic or interesting (depending on your genre) and memorable. Also consider that your book may become an audio book or even an e-book with text-to-speech features. Whereas Myra Mendelssohn rolls off rather easily, Myrtle Isles is more of a tongue twister and (sorry to any Myrtle Isles who may be our there) rather clumsy. Use your imagination - I bet there are lots of Jim Cook's out there already.
Thank you for your time and your thoughts.