Personal finance tracker

So I’m building a personal finance tracker, and am using csv files and pandas for my data manipulation. I haven’t worked with manipulating sql in python just yet otherwise I think I would use it. Any ways, I have some questions about ongoing data manipulation in general. When do I update the main csv files? just when i close the app, or is it better that I do it any time a change in the original data frames should reflect in the files?
thanks guys