The iPhone can function without a data plan, but the iPhone is designed to always have an internet connection as long as there is an available wi-fi network that you have access to, or cellular reception.
If you don't have a data plan, your monthly bill will be very expensive since there is no option to completely disable internet access via the cellular network unless you enable Airplane mode. You can request data access via the cellular network be disabled for your line/number at the source - with your carrier, but doing so negates how the iPhone is designed and intended. Visual voicemail access will not be available with T-Mobile's network in the U.S., and T-Mobile's 3G network in the U.S. is not compatible with the iPhone. Access will be EDGE or GPRS only.