Leaving Anafi is a small event. The island sits at the south-eastern tip of the Cyclades, beyond Santorini, and the big Blue Star ship that carries you back to Athens is often the only departure of the day. Most people who make it this far have come for exactly that remoteness: a hilltop Chora, long walks beneath the huge monolith on the south coast and beaches you share with a handful of others. The return trip is the price of that peace.
The direct ferry to Piraeus is a long, stop-and-go run through the middle of the Aegean. Blue Star Ferries operates it with conventional ships that call at other islands on the way, so the crossing time depends on the itinerary of the day. Ferryhopper lists a best case of 5 hr 35 min in this direction, while its month-by-month figures mostly sit between 7 and 9 hours, with the slowest at 9 hr 20 min. Think of it as a full travel day, not a quick transfer.
Timing matters more than on busier routes. Boats leave Anafi on only 2 to 4 days a week, so the weekday of your departure is fixed by the timetable rather than by your plans. If you have a flight out of Athens, work backwards from it: pick the sailing first, then make sure you land in Piraeus with time to spare, ideally the day before an international departure.
Fares are modest for such a long trip, from €45.50 for one adult when we checked, and cabins are worth considering if you want to rest. If the direct boat does not fit your dates, the short hop to Santorini opens up many more sailings to Piraeus and an airport. Either way, book early in July and August, when the few direct departures fill up with island-hoppers heading home.