Error 12 is an out of usable resources condition. It can be RAM, but could also be something else like virtual/video memory. The game can only address up to just short of 4 GB of RAM itself because it is a 32-bit executable, actually the hard upper limit is ~3.7 GB. Most of us find the danger zone is upwards of 3.5 GB. If it tries to reach for more than that even for a microsecond, it will crash or Error 12 upon trying to save.
According to Task Manager, how much RAM (in MB/GBs, not a %) is the game using once you start it up and the game clock begins moving forward smoothly? And again after a few sim hours or a real time hour? Which world(s) are you playing, are they heavily populated, is your active household very large or on an overly complicated residential lot stuffed full of objects, might their personal inventories be too full? Does a newly started test game behave better?
If it's not RAM usage directly causing this, Error 12s can also be triggered by very long and complicated CAS and Edit Town sessions, as well as by misbehaving mods and CC that just isn't working out right. If not averse to mod usage though, there are some NRaas mods specifically designed to improve game performance and lessen the chances of these things happening for no clear reason (in particular Overwatch, ErrorTrap, Traffic, Register, to an extent GoHere, and MasterController for an occasional Reset Everything run from City Hall).
Also please mention if you are on a Mac rather than Windows, because that triggers the need for a different conversation.