A quick way to get from Sorrento to Naples is by Circumvesuviana train. It runs every 30 minutes between Sorrento and Naples and makes stops in Pompei and Herculaneum. The journey takes about an hour and you pay € 2.10 per person (valid until 100 minutes after validation). You can consult the train timetable in advance.
TIP: In Naples, the train first makes a stop at the railway station at Piazza Garibaldi. The last stop is the terminus at Corso Garibaldi. From both stations you can take tram N° 1 or bus N° 151 in the direction of the harbor at Molo Beverello, at walking distance from the city center.
How do I get to the train station from the cruise port in Sorrento?
Sorrento train station is about 2 km from the port of Marina Piccola. It's possible to walk there, but the road is very steep. Count on about 30 to 40 minutes. The fastest option is a taxi. Expect to pay € 10 per taxi (4 persons, one way).
TIP: There's a bus every 15 minutes from the port to the train station (orange bus). You pay € 1.50 per person (one way).