Example project showing how to set up a saving score and high score system. In this example it will only save your score if you beat the previously saved high score.
In this it saves when you touch a button. In your game, you probably want to save when the game is over. So what ever triggers game over should also trigger your saving logic.