I look for trail information (if it’s new for me) online to get information on distance, elevation gain and estimate the time. After some trial and error, you can get a good estimate of when you need to turn around. I have also done laps on shorter trails, but enjoy a long hike up and then down.
Hope this is helpful.