I have calculated it myself and the answer is that it varies.
I used leech life on my shedninja on juan like cicada and measured it and it was 1/4 to 1/5 and I tried again after resetting and he used it at about the same point.But at some cases where the mon lives but the it uses recover to heal up I tested that as well and it was about the same as if they did not have recover.They also use potions when the Pokemon lives at low hp from the first hit to heal up.
This is making me conclude that the gym leaders use potion when there Pokemon has 1/4 to 1/5 of thier hp remaining