Ciao Linda and welcome to our community! I'm tagging the rail-travel experts at our @Traveler Experience Team7 to help you with this question. They'll reply to you right here in the community in this thread.
Meanwhile, however, if you're looking for a really convenient way to get to Pompeii from Naples, including a tour of Pompeii by a local archaeologist, a farm-to-table lunch and a wine tasting at a local award-winning vineyard, have a look at our ItaliaTours experience here: Pompei from Naples with Wine Tasting and Lunch12.
This tour takes all the logistical hassle out of the trip from Naples to the archaeological site and is a great value since it's a complete day trip.
I hope you enjoy your time in Italy, and ask any other questions here as you plan your trip. Thanks for being a member of our community!