Don't forget to buy food and drinks in advance if you need them: train stations do not always have shops, while onboard cafés are not always available and often very expensive.
When travelling on such short distances, you can take into account also busses and carpooling options: with some luck you will find very cheap options, even if you book on short notice.
What are the departure and arrival stations in Nakhon Pathom and Bangkok?
The trains to Bangkok can leave from Nakhon Pathom, Phuttamonthon Sai 2 or Sanam Chandra Palace and arrive at Bangkok, Jaran Sanitwong or Sam Sen.
How long does it take from Nakhon Pathom to Bangkok and when do the trains leave?
On average, it takes 1 hour and 6 minutes to get to Bangkok by train, but you will need 16 minutes with the fastest trains. The first one is available at 03:03, whereas the last one leaves Nakhon Pathom at 17:03.