It is certainly possible to visit the ruins at Pompei as a day trip out of Rome, but it makes for a very long and an extremely tiring day, because the ruins themselves are very extensive, and require at least a six-hour visit. Many travellers choose to return at least once to see the areas of Pompei missed during the first visit.
If you do the daytrip during the summer, you face the additional factor of high temperature and high humidity, which wears you down even more. And of course, after finishing the gruelling day in Pompei, you have to take two trains back to Rome.
Because Pompei is so fundamental to an appreciation of Roman social history, it really cannot be missed. Therefore, unless you're planning a return trip to Italy in the near future, I would at least make preliminary plans for a day trip.
Here's how it could be done:
Leave Rome Termini 7:25 Trenitalia AV train
Arrive Napoli Centrale 8:46
connect to Circumvesuviana commuter rail (underground at Napoli Centrale; follow the "Circumvesuviana" signs and take the escalators down)
Leave Napoli 9:10 Circumvesuviana train
Arrive Pompei Scavi 9:46
Leave Pompei Scavi 17:06 Circumvesuviana train
Arrive Napoli 17:42
Leave Napoli Centrale 18:16 Trenitalia AV train
Arrive Roma Termini 19:37
The round-trip adult fare for the AV trains is 84 Euros. The round-trip fare for the Circumvesuviana trains is 4.80 Euros (UNICO CAMPANIA Fascia 3 U3 ticket). You must buy a separate ticket to take the Circumvesuviana commuter train.
FYI, you can save lots of money by taking an IC train to Naples (or back to Rome), but that may reduce your stay in Pompei.
Children 12 or over pay full fare on the Trenitalia trains.
www.ferroviedellostato.it
www.vesuviana.it