That is a hard one and I've been there myself. For me, I usually have to stay until I know I've done all I can, until I know that there is nothing big that I would regret having not tried but more and more as I get older the time that I give it is less. I think also as you get older and get into more relationships you learn to be better at it--kinder, more giving, and forgiving, so that then if you do have to leave at least you know you acted the way you would like someone to treat you.