Ferries to Koh Samui, Koh Tao and Koh Phangan (that accept your car or scooter) leave from Donsak 70 km from Surat Thani, regulars boats to the same islands can depart from Chumphon. To go to Koh Chang, Koh Wai, Koh Mak, Koh Kood, departures are from the South of Trat (Laem Ngob). To go to Railay, which is not an island but an isthmus only accessible by sea, the departures are from Ao Nong or Chaofa Pier in Krabi. To go to Koh Phi Phi and Koh Lanta, boats depart from Krabi, Railay and Phuket and from Banphe near Rayong to go to Koh Samet island... Note that if you have booked a hotel, sometimes they also provide boat transfer to the island.
The easiest way to purchase boat tickets is to go directly to travel agencies or boat companies desks at the pier or to book them online on this website. Find out about the ticket prices by visiting companies websites (see below) to get an idea of the rates before you get there. And sometimes you can also book online. Be careful during ferry transfers if you travel with bus + ferry formula, do not leave anything valuable in the bus even in your luggage, sometimes there are thefts from suitcases during the trip.