The four-stroke piston engine is used in all cars and light trucks, and it doesn't matter if they burn gasoline or diesel. So what does four stroke mean? The crankshaft must go around twice, and each piston moves up and down two times, to produce one pulse of power. To put it another way, the piston goes up-down, up-down, for each firing of the spark plug.
Two stroke engines these days are only found in chainsaws, weed whackers, snowmobiles, outboard boat motors, and mopeds. These type of motors may make more power for a given size or weight, but they produce much more pollution.
In a four-stroke engine, the four strokes are:
1) Intake Stroke
Starting from "Top Dead Center" (TDC), and zero degrees of rotation, the piston moves down the cylinder. As the piston moves it creates a vacuum and the intake valve opens, sucking air into the cylinder. On carburetted engines, and on port and throttle body injected motors, the fuel come in with the air, while on direct injected motors it is squirted directly into the cylinder.
2) Compression Stroke
Now at "Bottom Dead Center" (BDC), the piston starts to move up again. The intake and exhaust valves are both closed and the fuel and air mixture is compressed by the piston into the combustion chamber. These days the compression ratio, the volume of the cylinder plus combustion chamber, compared to the volume of just the combustion chamber, can be anywhere from 8:1 to 12:1, or more in some race engines. Compressing the mixture greatly increases the amount of power produced by combustion, but the compression itself produced heat, which can cause detonation or pre-ignition.
3) Power Stroke
This is where all the magic happens! The spark plug fires igniting the mixture, as the piston is at the top of the stroke. The resultant explosion moves the piston rapidly back down the cylinder, turning the crankshaft,a nd making the car go. In a diesel engine, there is no spark, the mixture just spontaneously ignites at the right moment due to the heat of compression. In a single cylinder engine, at idle, you can practically hear each individual explosion.
4) Exhaust Stroke
The piston moves back up the cylinder because of the momentum produced during the power stroke and the weight of the flywheel (in a single cylinder motor), or due to the firing of other cylinders. The exhaust valve opens, and instead of compressing the burned gases, they are pushed out into the exhaust port. As the piston gets close to TDC again, the exhaust valve starts to close, and the intake starts to open, for a small period called "overlap" where the escaping exhaust creates suction that helps pull air in via the intake valve opening. The cycle then starts again, with the piston moving down on another intake stroke.