Can I use a gophone sims in a locked Iphone 4 and still get on the web without Wi-Fi?

My boyfriend bought a iPhone 4 which was on a contract. Can I go and buy a gophone sims and put it in the phone and it work plus get on the web without Wi-Fi?

Added (1). It was updated so it's an ios 7.1.1

If it's the same network then it should be ok, otherwise you'll need an unlock code.

If it's the same network then it should be ok, otherwise you will need to unlock your iPhone 4. For unlocking you can approach your service provider or else try to buy an unlocking service from any one of the online unlocking service provider like http://www.unlock-zone.com/apple-iphone-4/rs5wp9/ I hope it will be very useful to you.