What is the best way to see both sites in two days and Oplontis hopefully. Staying in Pompeii. Take the train to Naples and then what is the best way to do this.
Month of year? Do you mean best or cheapest? What time do you want to return to Rome? Can you afford a Naples car service for the day?
This is a massive undertaking that unrealistically treats a distant set of entirely separate destinations as if they were neighborhoods of Rome. Do you want to tick the boxes, or seriously visit these places? Quite a few posters on this board have spent 8 hours at Pompeii alone.
Starting research:
https://community.ricksteves.com/travel-forum/italy-reviews/day-trip-to-pompei-from-rome
Edit: It might be useful to explain how you chose Oplontis. I like it a lot, and it's actually a much shorter walk from the Circumvesuviana train stop (Torre Annunziata) than, for example, Herculaneum. But there is a FIVE site unified ticket option available, with two more equally important excavations. You would also need to make a decision about your midday meal; Restaurants are only open for a few lunch hours, and they are "slow food", which you don't have time for. ONLY Pompeii has a cafeteria line type faster food inside the attraction. But of course it has waiting lines from May to September. No food inside Herculaneum, just a candy machine, AFAIR.
I didn't get to Oplontis, but Pompeii and Herculaneum are easy to visit while staying in Pompei. Both are on the Circumvesuviana rail line; that's a sort of commuter train connecting Naples to Sorrento. It's often crowded and always not air-conditioned. It probably won't be very comfortable if you're traveling in the summer. There's also the Campania Express, which runs the same route as the Circumvesuviana but has newer carriages and air conditioning. I imagine it's worth the extra cost for a summer trip, but it runs only 4 times a day, so see whether the schedule meets your needs.
If you're staying in the modern city of Pompei and want to go straight to your lodging first (you can check luggage at Pompeii if you prefer to do that), you'd want to take a regular train from Naples rather the Circumvesuviana. The regular trains use a station in the modern city, while the Circumvesuviana and Campania Express go to the Pompeii Scavi station. I think the two stations are 20 to 30 minutes apart, but I haven't taken that walk and I haven't checked it on Google Maps. Starting out from your lodging to visit one of the two excavation sites, you'd want to walk over to the Pompeii scavi area either to visit Pompeii or get the Circumvesuviana to Herculaneum (Ercolano). I imagine there may be buses that would get you at least part of the way from your lodging to Pompeii Scavi but don't know for sure.
This website gives general travel instructions for Oplontis (scroll down) as well as Pompeii, Stabiae, etc.:
http://pompeiisites.org/en/visiting-info/how-to-get-there/
But there's a bus connecting Pompeii and Oplontis, so if you decide to see them on the same day, it's an option: http://pompeiisites.org/en/visiting-info/pompeii-arte-bus-timetables-and-methods/
I'd highly recommend a visit to Oplontis on the same day as you're in Pompeii. There is a free shuttle from Pompeii Scavi to there. You could also take the train one stop north and then Oplontis is a 5 minute walk from the station.
I'd consider Naples as a base if you're spending a couple of nights. Day 1 could be Pompeii and Oplontis and day 2 could start with the Archeological Museum in Naples followed by Herculaneum.
It would be a busy 2 days, but worth it.
I'm glad you're staying in Pompei. You could do Pompeii on one day, and then visit Herculaneum, Oplontis, and Stabiae on the other day. Well, that's what we did and it worked out great for us.
http://pompeiisites.org/en/stabiae/
We stayed at the Hotel Forum in April 2022, and hired guides through Askos. I highly recommend Garum for a excellent and reasonable meal.
I believe you have heavily edited your OP, so that it's no longer a daytrip from Rome. That's smart, but note that Pompeii the modern city is not a highlight of Italian tourism. If there are still rooms available (it's late for 2024 bookings), you might enjoy staying in Sorrento a bit more. It's a much longer (up to an hour) on the cheap Circumvesuviana local commuter train, but perhaps a more resort-like setting. (Note that Sorrento is built on a cliff. It's NOT a "beach" resort by itself.)
If, for example, you are an art history student and want to see all five places on the multi-ticket and nothing else, it's fine to stay in modern Pompeii. OTOH, Naples is closer to these sites, and quite a historic place (unlike Sorrento) in itself. Same cheap, crowded, hot commuter train. Naples might be cheaper than Sorrento, but many visitors find Naples a bit gritty and urban. As in "The Lying Lives of Adults" on Netflix.
These are excellent responses. Going in about two weeks and with your thoughts, I think I can do Pompeii/Herculaneum and perhaps Oplontis in two days. I might skip Oplontis and go to Pompeii Scavi twice. Thanks everyone for your thoughts !!
Note that most Pompeii type tickets are not good for two admissions, even the SAME day at the same place! (Haven't been there in 10 years) That's also why it's important that only Pompeii has food inside. I'm saying the 5-site ticket is only good once at each location.
You get to decide whether you go back to Pompeii! You may wish to walk the many extra steps to see if the Villa of the Mysteries is open. It's quite a special place, and perhaps the only one where the original frescoes are still in place. I'd only note that the three less-famous but very important sites are quite different from the others. There was a small touring museum show about seven years ago about Oplontis. And Herculaneum is quite different from Pompeii.
https://community.ricksteves.com/travel-forum/italy/herculaneum-and-pompeii-questions