There isnt a "one size fits all" answer to this. At the end of the day, if you have tried, and can honestly say to yourself that you gave it your all, the only thing you can do is move on, to save yourself resenting the person that you are with. Resentment is not a good thing!!
I have recently had to make a similar decision, and I can honestly say that I gave loads of chances, and made it clear that I needed things to change. When nothing happened, I had to walk away.