If you're going to Koh Samui via Bangkok, you will change planes, indeed, and probably airlines: few airlines go to Samui (it used to be a Bangkok Airways monopoly, and PG still have the lion's share of flights). I'm also assuming you're arriving in Suvarnabhumi (since DMK also serves as an international airport for low-cost carriers, there's a small possibility that you don't arrive at BKK).
When you arrive in Bangkok you have two choices: enter Bangkok proper, and visit (16 hours is a long time to wait in an airport), or indeed go to the domestic terminal (it's all the way at one end of the airport), pass through immigration and security, and wait a long time for your plane.
The second choice would be stupid, even if you're on a budget -- nothing is cheap in Suvarnabhumi, and you'll be bored senseless by the time you board your next plane.
Here is the airport map: the Domestic area is all the way to the left. Immigration in the middle.
Anyway I'd recommend you go to Bangkok and visit. Follow the crowd off the plane (most of them will be indeed heading to Immigration), and keep an eye for the blue signs.
Note that in many cases your luggage can be checked-in all the way to Samui (Bangkok Airways has many interline agreements), but this requires that you stay airside. Not ideal. If you wish to visit Bangkok, you'll have to pick up your luggage and check it in again later.
If you have a day-time layover, and don't want to pay for a hotel, you can store your luggage at the coin locker in Phaya Thai station, at the intersection of the Airport RailLink and BTS lines:
The Airport RailLink is the best and cheapest way to go downtown. 45 Baht, and zero traffic. The station is two floors below the arrival level. You go all the way to the terminus, Phaya Thai, and you're downtown. Plenty of things to do. Since you have a 16-hour layover, it means you really have about 12 hours: 1 hour to pass through Immigration, pick up your bags, find your way to the train. 45 minutes to Phaya Thai. And back. Arrive 1.5 hours before departure: that's 4 hours taken out of your 16. So you still have half a day in Bangkok. Not bad. Enjoy!