there are a couple of different options: You can book an accommodation and stay the night. Make sure you book in advance because the accommodation are usually fully booked close to the party. Most accommodation have a minimum of 3-7 day stay. Party all night and take the first (or later if you feel like it) ferry home. If it's possible leave your bags at someone who you trust close to the party. If your lucky enough you could try to stay the night with your hookup.
You don't have to book any transport in advance. Tickets for the Full Moon Party and transport (taxi / speedboat / ferry's) are widely available. If you would like an accommodation close to the Full Moon Party you should book in advance. Most of the accommodations are fully booked close to the party.
Speedboats and taxis are available all night. Speedboats are crowded and we advise you to go a bit earlier. The sea is not as rough and the boats are less crowded.