Do I have to get a sim card and contract to use an iphone?

I want to know if you have to get a SIM card and contract to use the iphone or can i just use it for games and music?

Depends on the carrier involved. If a CDMA one like Verizon, then no since they don't use SIM cards.

iPhones can be used on prepaid plans as well, therefore, no contract.

If you just plan on getting one for games & music just get an iPod touch. Cheaper & more to the point of what you want & nothing you don't.