Leaving Santorini for Rafina rather than Piraeus makes sense for one kind of traveller above all: the one heading for Athens airport. Rafina, a small port on the east coast of Attica, is only about 26 km from Athens International Airport, while Piraeus sits on the far side of the city. If the dates line up, this route can take you from the caldera to the airport side of Athens in a single day.
The catch is frequency. Ferryhopper lists sailings in this direction only from May to October, and in most months of last year's data there were two or three a week, with a daily service in just one month. It is a route to plan around, not one to count on at short notice, and in winter it does not run at all.
You will leave from Athinios, the port below the cliffs on Santorini's west coast, and the trip is long: around six hours on the Golden Star Ferries high-speed boat, which runs up the Cyclades to the Attica coast, and nearly twelve hours on the occasional Fast Ferries conventional sailing. Choose your departure with the arrival time in mind, especially if you have a flight or a hotel to reach at the other end.
Because Santorini is so busy in summer, the hardest part of the day is often reaching the port. Transfers to Athinios sell out and the single cliff road can jam when several ships are due, so book your ride down the day before and leave early.