That's an excellent question. The answer depends on what you want to do, of course. From my perspective two days is enough in Bangkok if you have other interests and temples, city bars, and shopping aren't a huge draw.
Typically people fly into Bangkok and use it as a travel point of departure, usually taking a second flight to go to another place. If you wanted to go to a place that is accessible by a train the night trains are a convenient and inexpensive way to travel, since roughly 1000 baht covers both the trip cost and lodging for that night (sleeper car version). But a train wouldn't go directly all the way to Phuket, and adding a bus section to a train section might be troublesome, so it would be more typical to fly a second round trip for that.
There are two airports in Bangkok, Suvarnibhumi for international flights and Don Meuang for domestic travel. Of course there is potential for that to be a problem for trying to connect immediately since the two are roughly two hours drive from each other, in opposite parts of the city. Domestic flights should be relatively inexpensive through budget oriented carriers like Asia Air or Nok Air, you just probably wouldn't get even a snack on those and would want to check luggage weight or bag count restrictions.
I've just talked to two other sets of tourists in Vietnam about where to go in Thailand in almost the same conversation, and the conclusion was very different for both depending on their prior plans and interests. One group was already going to Phuket and asked which islands to travel on to from there, and my wife suggested Phi Phi island (which I've not been to, although I have been to Phuket, Samui, Hua Hin, Cha Am, Pattaya, and Krabi). The other said they only had a limited time traveling directly out of Bangkok, and conversation led to suggesting Hua Hin, a Gulf of Thailand land-based resort (versus Phi Phi on the East in the Andaman Sea, Part of the Indian Ocean).
At work people have suggested both islands of Koh Chang and Koh Sumet, (Koh means island), both not that far from Bangkok, so a bus trip of some sort would work (roughly 2+ hours for Sumet and 3+ hours for Chang, maybe, plus a bit of ferry transport). Or Hua Hin is ok, not as nice as an island I'd expect but a decent resort town, just a little plain (to me). I'm not a big fan of Phuket but maybe that's just me, and I'd hope the other islands are nicer than Samui.
If actually going in the sea (snorkeling, etc.) is the goal then that changes things. I've never seen sea water clear enough for me to see anything if I had went in it in Thailand but the best bet is probably the Phi Phi vicinity. Just don't go to Pataya; it's for a different type of tourist.