If you don't want to, or don't have enough time to, leave the airport at Bangkok, you can just stay air-side and never go through Immigration and Customs, but there are some issues to keep in mind, if you book separately:
- The Thai government charges a (IIRC) 500-baht exit fee, which is simply tacked on to your airfare when you buy a ticket for a journey apparently terminating in Thailand.
- If you have have two separate tickets, the airlines will typically not "interline" your checked baggage. You will have to go through Immigration, get your bags, go through Customs, and check in to the Cambodian flight. Issues like that are why I tend not to check baggage at all.
- There are two international airports in Bangkok. You will certainly fly into Suvarnabhumi (BKK), but the flight to Cambodia might very well originate from Don Muang (DMK). Check carefully. It's reasonably easy to get between the two, but you have to actually do it.
- If you buy two tickets, and the first flight is so delayed that you miss the second, you are majorly buggered. You might have to buy whole new tickets.
- BOM is the closest international airport to you, I take it, since there are dozens of international airports closer to Phnom Penh. You might find it more economical to take an Indigo or SpiceJet flight to New Dehli and fly to Phnom Penh from there.
- On the other hand, Bangkok is an interesting and exciting city, especially compared to dour, hard-scrabble Phnom Penh, and I advise everyone to see it. It's also barely more expensive than Phnom Penh (and cheaper than Mumbai) If I were you, I would allow a day or two on each end of the Cambodia trip.
Edit: your profile suggests you are in Sri Lanka. Are you leaving from Colombo originally? Thai Airways and Sri Lankan Air both offer direct flights from Bandaranaike International to Suvarnabhumi at very reasonable prices.