When your car is stopped and parked on a smooth surface, it should not rock back and forth. It's a good idea to check and see if you have the parking brake on. If you don't, it's a good time to put it on and leave the car there until you need to use it again.
If your car is jolting when it's stopped, there could be a problem with your suspension system. When you brake, the weight of the car shifts forward and compresses the front suspension, causing the rear of the car to rise. This can cause the rocking feeling you are experiencing. A mechanic can inspect your suspension and recommend the best solution for the issue.
Other causes of your car rocking while stopped include issues with your engine and transmission internals. These are the only parts of the vehicle that might still be in motion when your car is stopped, so they could be causing the vibrations. Other culprits can be your spark plugs or fuel intake, as well as problems with the brakes, motor mount, or tire balance. If you have any of these concerns, it's a good idea to have a professional like one from YourMechanic come out and take a look at your car to offer a personal diagnosis for your vehicle.