Ferries connect Mykonos to Athens, and to several of the islands (including Andros, Ios, Naxos, Paros, Santorini, Syros and Tinos) throughout the year (although many services stop between late October and April). From Athens, they depart from the port of Piraeus (it can be reached by Metro), taking around 5 hours to reach Mykonos, and from the port of Rafina (a less accessible bus ride away), taking 2h30m to reach Mykonos). If you’re heading to Mykonos directly from Athens' airport, Rafina is the better option, while the port of Piraeus is closer if you’re staying in the center of the city before your trip to Mykonos.
In the high season (from May to September), there are good connections with the neighboring islands, including the popular Santorini and Paros.
Tickets can NOT be bought on board, you need to head to an agency at the port, or book them online in advance. It's always a good idea to book in advance, especially for the month of August. Keep in mind, however, that if you do book online, you still have to present your printout and collect the actual ticket at an agency. Look for the agency that represents your ferry company (which will either be Blue Star Ferries, Hellenic Seaways, or Seajets). If you’re connecting between islands, note that during especially windy days, ferries may be delayed or even cancelled.
There are two ports in Mykonos -- the Old Port (just about 400m north of the center of Mykonos Town) and the New Port (2km north of town). Few ferries now dock at the Old Port, with all fast and conventional ferries now docking at the New Port.
Hotels often arrange transfers from the port, but you may also pre-book a shared or private transfer: