Cooper and Brand were only on the surface of that planet for less than an hour (45 minutes) most of it waiting for the landing craft to dry out. And I think they cut that short too, because another huge wave was coming. One hour = 7 years. Where did the 23 years come from?
Ok, assuming some pretty significant facts. I think the time dilution would have started as they got closer to the planet, because if it happening right new to the Endurance, then the Endurance would have been affected as well.
Which raises a bigger question. Why didn't they just bring the Endurance down close to the planet to reduce the effect of the time distortion? My man wouldn't have had to sit around with a protein IV drip for 23 years, maybe only 3 or 4. Hell, they could have brought the Endurance down with the landing craft and hovered it at 3000 feet.
No, the Endurance was sitting just outside of the time dilation. Coop thought it would be like 1 hour, but they got delayed. It's a space station, not a ship, they can only stay in orbit. If they knew it would take long, I'm sure they would've put it in low orbit.