I am thinking of creating a program where you can keep track of things. But I don't really know how to keep the stats after you close the program
You would have to save that data to a file before the app closes.
Look at this: https://godotengine.org/qa/36487/how-do-i-save-settings-in-a-config-file
And this: https://gdscript.com/how-to-save-and-load-godot-game-data