SOHC stands for Single Overhead Camshaft. That means that there is only one camshaft per header. Inline engines will contain one camshaft. V-type and/or flat will contain 2 camshafts. For a SOHC engine there are usually 2 valves per cylinder but there can be more with the addition of cams for each valve.
DOHC stands for Double Overhead Camshaft. Now there are 2 camshafts per header. So in an inline there are 2 camshafts because there is only one header, but there is 4 in a V-type or flat engine. These DOHC engines usually have 4 valves. One camshaft for the exhaust valves and the other for the intake valves.
Advantages to having a DOHC engine over a SOHC is that the engine has twice as many intake and exhaust valves as a SOHC motor. This makes the engine run cooler and more smoothly, quietly, and efficiently. But the downfall is that DOHC engines cost more for repairs. To ensure against expensive engine repairs, make sure you change your engine's timing belt about every 60,000 miles.
There are some other valve combinations as well. Some engines, like the D15 in a Civic and the C30 in an Accord, have 4 valves per cylinder but are SOHC engines. This means there are four lobes on one camshaft per cylinder. With four lobes, or cams, per cylinder, they become smaller and wear easier which is a draw back to this setup. With one camshaft though, this will make the car lighter which creates better performance.
Another variation is 5 valves per cylinder developed mostly in newer Audi's. There are 3 cams on one camshaft and 2 on the other. The set with 2 cams runs 2 valves that are used for exhaust and the 3 on the other camshaft are used for the intake. Cars with 5 valves tend to be quieter and have better performance. Although if something goes wrong it can be costly to fix because parts are harder to find and more expensive.
The alternative to overhead cams are pushrods. Pushrods are used in V-Type engines or flat engines. In a pushrod engine there is one camshaft in the center of the trough made by the V. Here are the sequence of events: The camshaft rotates. The cams push the pushrods up. The pushrods push the rocker arms inside the cylinder head. The rocker arms pivot and push the valve down, hence opening the valves occurs. There are springs that push the valves up and back into closed position. This occurs of course after the lobe on the camshaft is away from the pushrod. The advantage to using this camshaft position is that a single camshaft runs all cylinders. This engine set up is still used by chevorlet in their LS-1 and LS-2 engines. Both engines are used in Corvettes, 1998-2002 Camaros, Trans-Ams, and the new GTO's.