Like others have mentioned, when I am in the position of helping someone, I detach. Honestly, I find it very difficult to help people who will not help themselves. I've once had someone tell me, "well, I guess you're my therapist now" and I was horrified; so horrified I wanted to run. I feel very guilty thinking in such a way, but I do not like to be in a position of being depended on, because the responsibility I assume amplifies my perfectionist tendencies... and failing people is my worst nightmare. I have the tendency to become so involved (in my mind) that I become overwhelmed, and I need to get away so badly, that I stop helping altogether and shut the person out. I look like a horrible person, because I become so overwhelmed I cannot deal with this person altogether, and don't explain my position.
I've seen therapists walk away from certain jobs because they can't handle the continuous mental and emotional energy it takes to listen to people continuously about their issues, so that breaking point is a genuine point of contention that needs to be dealt with. Perhaps explaining your needs and laying out ground rules may help you. It's not to limit or truncate communication, but to help create a suitable environment for you and the people you listen to. For example, you tell friends who are penchant to venting to you, that weekends (or weekdays) are your time off from serious 'sessions'. This is a general rule of course, and you might mention that you are happy to talk to them if they genuinely need someone to talk to and are desperate. I have made the point of mentioning before, that sometimes I am helping multiple people at a time, and it takes a lot of my energy. Usually when alerted to this fact, friends understand this, and they are less inclined to blame me if I don't listen to them straight away, or need time away.
My personal experience- I have learned to detach in these instances, by thinking of myself as playing a role. I am no longer myself or a friend, I am a counselor whose job it is to help this person. My job ends at the point of the counseling session. After that, I become a friend again.
My aim is to encourage and empower this person to take control of their life, by making this person think they have done all the work they are doing with me, theirselves. So it is not to encourage them to attach to me, and affiliate me with their hero or rescuer, but to see their own self as their own hero. It is not my job to save this person; I do not fail if positive outcomes are not the result of my time with them. I recognise that people make their own choices, and I cannot make someone do anything.
I find this helps make the best of the situation, and to take off the pressure I put on myself, if the person doesn't seem to be getting any 'better'.
For every hour or so, listening to a friend, you might take 2-3 hours to yourself to re-energise; "Me time". I find I get snappy and judgmental when my energy is depleted and I feel like i'm being used. But when I am energised, I am more inclined to be able to detach and feel less used, and more 'useful'. Giving yourself positive reinforcement is also good; because sometimes people don't express gratitude and it feels like your listening and input is falling on deaf ears.
Staying in touch with your own needs is key. Recognise when it's getting too much for you; look for the key signs that lead up to it, and be proactive about it. What do you need to keep yourself from reaching breaking point, and what can you do to maintain balance within yourself? do you need more time to recuperate? do you need somewhere to make sense of these peoples situations, and their complaints? (i.e. taking up a venting journal, where you allow yourself to be honest about these people, and come to an understanding). Do you need to limit yourself to focusing on one person at a time? do you need to find acceptance within yourself, to be ok with putting your foot down and just saying no in some instances? (admittedly, that's been difficult for me).
It seems to me (in my experience anyway) that when I have become overwhelmed, it's been a case of communication being too one way. In order to bring balance back into the equation, i've had to point out (through an understanding tone) the unbalance in communication; that no one is to blame; and that order needs to be re established, otherwise something is going to give. Most people understand this, and when I ask them to devise a way to create more balance in order for us to be parners (i.e. I express that I'd like to keep the partnership going), they leap at the opportunity. I've never been in the situation where i've given someone an ultimatum (change- or our friendship will be terminated; lol, sounds so formal, but i'm pretty decisive like that), but I think some contexts (where the person is literally, knowingly being a leech) calls for it, unfortunately.