DEP stands for Data Execution Prevention. You see, when your computer "feels" like it's going to overburden itself with work, it figures it should shut down any heavy programs you have running. For short, your PC shuts down Sims because it's a load.
You can find DEP by going to My Computer, Properties, Advanced, Performance, Data Execution Prevention. You will see an exception list. Basically, any program you put in that list will not be shut down by your computer's safety phobias.
The Sims 3 is known for crashes for 2 major reasons. One is not having enough RAM in your computer (4 GB should do it perfectly). The second is DEP.
If DEP is your reason, then all you must do is open DEP's exception list and add the TS3 executables to it. They are generally found at C:\Program Files\Electronic Arts\The Sims 3\Game\Bin (look for TS3.exe) and and, in the case of Pets, also in C:\Program Files\Electronic Arts\The Sims 3 Pets\Game\Bin (look for TS3EP05.exe). If you use the launcher, make sure to add the launchers' executables to the list too, just to be sure.
It's also good to remember to clean your game's cache every once in a while, and to make sure to have at least 10 GB of free HD space when playing. Also, make sure your computer is not overheating.