As a combination of the above points:
By default, your iPhone should have data roaming set to "OFF".
Check in:
Settings > General > Cellular
With that set to "OFF", your iPhone will not send and receive data over the cellular network when roaming internationally. You can still make/receive calls and text messages, but you'll obviously be charged for that.
If you only want to use Wi-Fi, then you can turn Airplane Mode ON and then turn the Wi-Fi back on in the Settings App. That will mean that you can use Wi-Fi for internet access, but you won't be able to make or receive calls and text messages. If you have iMessage enabled, that should work over Wi-Fi.
If you are primarily concerned about cost, and your phone is unlocked or can be unlocked easily, you might like to buy a SIM in whatever country you're going to (might be helpful if you actually said where you're going!). That would allow you to use a local carrier at the local rates. Depending on where you go, that might be difficult to sort out. It'll also depend on which carrier you are on (again, you didn't say!) and which country you're from (presumably the US).