At .87c, gamma (

) ~2 because
If the planets are at rest in relation to each other (you gave no details indicating otherwise), and person C is at rest equidistant between the planets , then:
If person C observes that person A, whilst travelling at .87c, took 10 hours to go from A to B:
Person A finds that their journey only took 5 hours, because their own journey time is divided by
Person B observes that the journey of person A took 10 hours, because person B is at rest in relation to person C, and the planets are at rest in relation to each other. Person A is moving at .87c relative to both B and C, so both persons B and C will see the journey take the same amount of time, twice the time that the journey actually takes from the frame of person A.
Persons B and C calculate the distance between the planets to be 8.7 light hours, because it took someone travelling at .87c 10 hours to make the journey.
Person A calculates the distance between the planets to have been 4.35 light hours, because it only took them 5 hours when travelling at .87c, which means they could only have crossed a distance of 4.35 light hours in that time. Or, to put it another way, to person A, planets A and B are both moving in the same direction at .87c in relation to themselves, so the distance between those planets when they are at rest in relation to the observer is length contracted by the factor

along the axis of motion.
Hopefully someone else here can put this more succinctly.
EDIT: I see x0x already did so, whilst I was composing this. I approximated .87c to have a gamma of 2, when it is actually closer to .866c where gamma is 2.