Why does my Iphone3GS crash when i play games?

Every game i play in my Iphone 3GS it crashes and sends me back to the home screen, i played these games before and never crashed, now every other game it crashes with the exception of Angry Birds, that i can play normally.

All the other games even these who never crashed before as above, all freeze and crash. How can this be fixed?

I think the hardware is just getting to outdated, 3GS is a good phone but that came out around 6 years ago. 4S is free on a 2 year contract, why not upgrade and get that?