Using the Messages app, you can send:
- iMessages (in blue text boxes)
- Texts (aka SMS) (in green text boxes)
iMessage relies on a data-connection, that is: Edge/3G/4G/LTE/Wifi/Whatever. This is needed so it can encrypt your messages and add special effects/photos/video/etc. The Messages app will use the data-connection by default to send your messages. If a message does not get sent, because you have no WiFi or cellular data connection, it will not be sent until you've restored the data connection.
You can however choose to send the iMessage as text. If you choose to do so, your text will be sent unencrypted, and without any special effects. If you included images or video, these will get sent through MMS, if your carrier supports this.
Long story short: yes, iMessage depends on a data connection. Just like any messenger app such as Whatsapp or FB Messenger.
[doublepost=1530098371][/doublepost]By the way, if you go to Settings > Messages, you can opt to "Send as text". If iMessage is unavailable, the iPhone will automatically send your message as a text.