This sentence used to be a typical answer to someone collecting money on behalf of some charity or similar organization (e.g. la Croix-Rouge) by someone who was already asked by someone else from the same organization, and already donate money to it. The idea is to tell you are not refusing to donate, just can't do it multiple time in a short period of time.
— Bonjour, est-ce que je peux vous demander de l'argent pour l'opération « Pièces jaunes 2019 » ?
— Oh, désolé. Je n'en ai plus. J'ai déjà donné.
The very same expression might also be used even when no initial donation exists, just to avoid telling you do not want or cannot afford to help.
As the other replies already stated, it can also be used figuratively to state you had some experience that cost or bothered you and do not want to repeat. This is likely by far the most common usage nowadays.
— Les crédits à taux variable, on a déjà donné !
— Les repas de Noël avec tes cousins, j'ai déjà donné !
— Travailler le dimanche, j'ai déjà donné !