If you either want to do stuff like processing or analyzing it on the backend, or let users access their data from other devices, use a database. If not, use local storage.
Local storage has the benefit of saving you bandwidth and storage cost, no matter how much your users save, and probably more privacy.
Databases on the other hand, allow you to „do stuff“ with the data when the user is offline, share it through cross-device sessions and things like that. However the users can’t be sure what you are doing with it.