Here is some helpful information on how the iPhone iMessage feature works and how to use it to avoid unexpected data charges.
iMessage is Apple's built-in instant messaging (IM) service that lets you send messages quickly and easily to anyone else using iMessage on Apple products.
iMessage sends messages over Wi-Fi or cellular data when Wi-Fi is unavailable, rather than through traditional SMS. This means, if you do not have a data plan and are not connected to Wi-Fi, you will incur pay-per-use data charges when using iMessage.
If you only want to use iMessage in a Wi-Fi connected area, please ensure you turn off iMessage when leaving a Wi-Fi connected area to avoid unexpected data charges, or turn on “Send as SMS” to ensure you can still send and receive regular text messages where there is no data.