As stated above, make sure your RTH altitude is set for a lot more than you think you might ever need. And watch your battery level. The final precaution is just to make sure the home point is updated when you take off. With those precautions, fly as far as you want. Fly until you lose contact completely. Your P4 will come back to you as long as you set the right parameters before flight. It's a bit worrisome at first, but soon you get comfortable with it. You will have contact reestablished well before your drone gets home, at which time you can cancel the automatic return to home. One more thing to watch out for is when you do a firmware update, you will lose all of your settings so it is important to reset them before your next flight.
This is not the best advise, at least the part about flying as far as you can irregardless of other important factors. You can't count on it just coming back to you. External factors such as aggressive or unexpected wind gusts not to mention battery level are the top two reasons you don't and should not do that.
A little common sense needs to be used when flying far out. In case you don't have said common sense here are some bullet points to be mindful of regarding your max range in a given environment.
1) Don't take off before having a good GPS Satelite lock and home point recorded.
2) fly on a calm day with winds sub 10mph or ideally sub 6mph if you're going for max range flights.
3) of flying on a windy day when you fly out make sure you're flying against the wind so you can have some assurance that the return trip will be faster. Always give yourself a buffer in case winds change direction during your flight.
4) it's usually safe to fly as far out or usually further out than the DJI Go app return to home warning. But if you want to err on the safe side fly as far as you can and start heading back when or shortly after the return to home power level warning.
5) I most always find I get home with plenty of battery to spare when returning when the app warns me. So if you want to push the envelope a bit you can fly out till you are between 55 and 60% battery life remaining. Extreme distance flyers will push that even further if they believe they will be flying back with a tail wind reducing the time to return. Problem with that is you will be landing with just a few if any percentage to spare in battery so it's not worth the risk to me.
6) For max range use ATTI mode, GPS will still be working but it no longer will use position hold. This is not a big deal since you're not trying to hold station you're flying back and I consistently get increased speeds flying in ATTI mode. If you want to add some battery buffer let's say you fly out no further than 50 -55% remaining battery and fly back in ATTI mode with a tail wind behind you pushing you even faster in the return.
That's mainly it. I've flown over 6k feet away on my Phantom 3 returning with plenty of battery to spare (on relatively calm days) so you can get pretty far with the Phantom especially if you're using the Phantom 4.