Will you be checking luggage for your flight from San Francisco, or doing carry-on luggage? Checking your bag(s) could mean waiting at a baggage carousel, even after you’ve gotten off your flight in Rome and then waited in line to have your passport checked at Immigration Control, which you’ll definitely be doing. If you wanted to check the luggage again for a flight to Naples, you’d already be too late before you even landed in Rome to check it to Naples. Doing carry-on luggage all the way would be your only chance, however slim.
Trains (or bus) are, of course, are also options for Naples. For Sorrento, you’ll have to go by trains (or bus) for at least part of the trip.
In September 2021, we arrived at Fiumicino from Dallas at about 7:00 AM, when it wasn’t busy. That was more than 2 years ago, so might be different in 2024, but it still took a while. We had a bit of a wait to get passports checked, then hustled past the baggage carousels, where people’s luggage was arriving. We did carry-on, but it looks as if checking bags might not have been a huge hindrance that day. The Leonardo Express ticket machines were just past the carousels, and there was uniformed staff at the machines to help us get tickets quickly. The next Leonardo Express train departed just a moment later, and reaching the Termini Station downtown, we scrambled thru the station to buy tickets and catch the next train departing for our destination, Bologna. Had we been flying instead, we would’ve stayed at Fiumicino, but (unless it was the same airline we’d flown on from the USA, or a partner airline) we’d also have had to check in again, go thru security, and make our way to the departure gate. Time and patience would be needed! I wonder if, whether you decide on Naples or Sorrento, simply planning on going by train will overall save you headaches, time, AND money?