Why does your engine shake after you turn off the ignition?

The condition has many names, "run on", "piston glow", "dieseling"... basically, the carbon deposits in the engine are hot enough that once you turn off the engine the heat from the carbon deposits will continue to ignite the fuel, keeping the engine SORT of running.

That was one of the many reasons for going to EFI. In an EFI engine, once the key is turned off, the injectors STOP injecting fuel and the engine stops.

If your vehicle is EFI, you probably have a leaky injector.

If your vehicle has a carburetor, it's "run on", and you might get a little benefit from a tune-up and possibly a carburetor rebuild.