I would say whenever you feel you just can't take anymore and you and your daughter are suffering as a result. BF may be best but not at the cost of your stress and not enjoying her.
I have two experiences - my first child Ihad a long hard labour and she was born with a nerve injury to her arm. I was exhausted, she was in pain and we had constant visits to the hospital to try sort her arm. BF was a nightmare. She never latched, I got mastitis, nipples like craters (despite help from midwives, BF councillors and HVs) and she just kept losing weight. After 2 weeks I was a woman on the edge dangerously close to PND - all I did was cry. I decided enough was enough after a weigh in with my daughter but giving her a bottle I sobbed wracked with guilt at having failed as I saw it. I never really let go of that guilt.
Two and a half years on I have a 5 week old. From the first feed he latched on well and we are still BF. It hasn't been easy with mastitis again, sore nipples, thrush and an infection but we have turned a corner and it is so much easier. The difference with my daughter is he is really willing to BF and latches with no problem and is gaining weight.
I still feel guilty for FF my daughter but she has certaninly not ailed from it and it was the best for me, her (and my husband who was so worried about us both)at the time. Each baby is different and whilst people come up with potential solutions to your problems i know you get to a point where you just can't take anymore.
Only you know if you are at that point. BF can be really hard at first but whilst I had problems with both babies my daughters failure to gain weight and latch pushed me over the edge. Once I started formula she was a different baby and I started to feel like me again.
~I know there are lots of diehard BFers out there which may disagree, and whilst I believe so strongly in it, I don't think it should be to the detriment of you or your baby.
Sorry - rather a long post but hope it helps a bit!