Question:> Should I wait to have the counter tops installed or does this matter?
Answer: It doesn't usually matter what order, however, I'd paint the cabinets before you install new countertops as this is usually how it goes with new cabinet installs. Painting them first is standard procedure.
Being said... we can paint cabinets before or after. Its highly unlikely counter tops would ever impose a problem to the installer or suffer damage from the installation of new counter-tops. They measure to fit. They also just sit on top of your cabinet frame and don't touch anywhere that imposes an issue. If by chance something may happen, touching up is as easy as a call away.
On the other hand, if the cabinets should sustain unexpected minor nicks from anything for that matter, assuming we aren't talking about refinishing a door from a massive impact... we would most likely do minor touch-ups as a free service.