This is far from a simple question, and i doubt I could give a thorough answer without writing a book, or two. I guess, though, a lot of it boils down to that point when your sacrifices and compromises cease to be a matter of decision, and more a matter of practice. I know that there have been times in my life when I have allowed myself to be taken advantage of by friends and loved ones. When I decided that I had had enough, I announced that I would no longer allow it to happen. Sometimes, those who had been taking advantage adjusted their behavior, because they never thought about how they were being selfish. Other times... well, it got messy, and I'll leave it at that.
On the flipside, I can admit that I have been guilty of taking advantage, myself. It's part of human nature, and we can't deny that. I am proud of the fact that, once it was pointed out to me, I stopped my behavior.
I would advise that, rather than try and analyze where the line actually is, go with your gut. If you feel that you aren't appreciated, or if you are being used, point it out to the offender. If they are doing it without truly realizing it, you will be amazed at how quickly they are capable of turning behavior around. If not, it may be time to cut ties and free yourself from that situation.