Everything is stored on the phone (and on iCloud if you set it up).
The only action you can perform with the SIM card memory is to import your contacts from it to the phone. Unless you jailbreak your iPhone, there's not even a way to modify or save the contacts back to the SIM.
Messages are stored in the iPhone as well and you can back them up too on iCloud.