There are many possibilities when travelling to Koh Tao, depending on where you are departing from. In the end though, the last leg of the trip will have to be by boat.
You can purchase a joint ticket (VIP Bus + Ferry) to Koh Tao from BKK. Getting to Koh Tao this way takes about 7 hours by road plus 2 hours by ferry from Chumphon. Just go to any travel agent on Khao San road and purchase your ticket or book online by visiting www.lomprayah.com.
Two departure times are offered, leaving Bangkok at 9pm or 6am, arriving on Koh Tao at 6am or 2.45pm respectively. Tickets cost 850 Baht.
Online booking must be completed 3 days before date of travel. Using a travel agent is probably a better choice as tickets can be booked on day of departure.

The easiest option would be to book your ticket at any travel agent you will see on both of these islands. Boats from Koh Samui depart at 8am and 12.30pm, arriving on Koh Tao 1 hour and 45 minutes later. Boats from Koh Phangan depart at 8.30am and 1.30pm, arriving on Koh Tao 1 hour and 15 minutes later!
Getting to Koh Tao from here is easy. Two departure times are offered, 7am and 1pm, arriving on Koh Tao 1 hour and 45 minutes later.
There is a regular night boat which departs from the ferry pier every night at 11pm and arrives in Koh Tao at roughly 6am.