I assume you are changing these values from the Gamerules menu.
If so, towards the bottom of the menu, next to Ok and Cancel, there should be a ticked box that says Start New Game, or something similar. Untick that box, and your game will no longer reset when you change a specific value.