This is a common problem that can be caused by a couple of things. Some people call this "dieseling" or "run-on". What is happening is, when you shut the ignition off, something, somehow is causing a couple of the cylinders to keep igniting, which in turn keeps the engine running, although "sputtering" pretty badly. This can be caused by excessive carbon build-up in the combustion chambers or on the piston tops which when hot, acts like little glow plugs. This is common on engines that run way too rich or have oil burning problems. Dieseling is a common problem with high compression / high performance engines, especially in warm weather or when the engine is hot. In this case, it is usually caused by running "cheap" gas with inadequate octane. It can usually be remedied by switching to a higher octane fuel.
In milder street engines, another big cause for engine run-on is having the idle set too high, or the carb misadjusted which requires the idle speed screw to be screwed-in too far. When the idle speed screw is screwed-in too far, it opens the throttle plates too wide and when you shut the engine off, the inertia of the spinning engine still pulls air (and fuel) through the carb and into the cylinders and the heat built-up inside the combustion chambers is enough to light a few of the cylinders at random to keep the engine spinning and sputtering. Again, this is especially true with fuel that isn't high enough in octane. The more the octane, the less volitile the fuel. Even though the key is off, the engine won't stop sputtering because the throttle plates are opened up enough to still pass fuel and air. This is why more modern cars with carburetors had idle stop solenoids and electronic injectors that shut the fuel and air off, (as well as the ignition), when the key is turned off.
Carburetors aren't electric, so even when you shut off the ignition, the inertia of the engine is still moving, (and sucking-in air), and as long as it is still rotating, the fuel and air is still flowing through that carb feeding the cylinders and even though the ignition is off, hot carbon in the cylinders can continue to ignite that fuel.
There is a true way to remedy this problem which involves the vacuum advance and the ignition timing. Even though the timing has nothing to do with engine run-on, (because they key is turned off and "ignition timing" is no longer in play), there IS a way to fix this problem once and for all on just about any engine, but it would take me a while to explain that and I already give enough free info on here as it is. If you want to learn about the really cool stuff like that, you're going to have to buy my Performance Tuning DVD set and learn how this stuff works :-) If you find that you can't tune out the problem yourself, then there is a quick solution. It won't fix the problem but it stops the symptoms. In cars equipped with automatic transmissions you can simply shut the engine off while still in "Drive" and the load from the tranny will cause the engine to shut right off. Manual transmission cars can be shut off while in gear (with the clutch pedal down) letting the pedal back up slowly when the key is turned off to load down the engine a little thus not allowing it to run-on.