hi, to better address the root of the problem and it´s possible fix, we need you to post your system specifications, such as: video card, ram, CPU, hard drive.
also tell us if you have installed any patch lately, video card driver version.
are you getting this problem with other games?
have you noticed any time frame pattern? for example, after 10min of game play.
try a Clean boot to disable the programs running on the background, that could be affecting your game play.
download and install the latest driver for your video card.
check the temperature of your system, if it's running hot, it will cause issues with your gamming. use this program called HWmonitor.
Do you have the latest drivers for your components and the latest patches for the Sims 2?
Here's the link to the latest DirectX
Here's the page with the latest Sims 2 Patches
Also, be sure that your graphics card has the latest driver. You could get it by searching for your model in HP's website.