There is no such thing as safe duration in engaging in a hi-fun session. Set a limit of how long you will engage in a session. Try to keep it less than 8 hours. Set an alarm and/or ask your sober friend to call/come over to remind you to stop the session (if you’re hosting) or leave from a session (if you’re a guest) at the designated time.
Recreational drugs often delay exhaustion. Take regular breaks.
Long fuck sessions can cause condoms to break, and while being on drugs, it can really wreck your body and sometimes even push past your limits and boundaries.