Valves are designed to seal the combustion chamber during the compression and combustion cycles in a four-stroke engine (two-stroke engines use them too, but the timing is different). Two valves per cylinder, an intake valve and an exhaust valve, are the essential number of valves per cylinder, but many modern engines have more. During the intake process, the piston pulls air in through the intake; the intake valve is open at this time. During compression, the piston compresses the air/fuel mixture and all valves are closed. After the air/fuel mixture is ignited by a spark plug (in a gasoline engine), the piston is pushed down, and the valves remain closed. The exhaust valve opens to let the exhaust out, which is made possible by the piston moving upwards again.
Overhead Cam at High RPM
Exhaust valves and their openings are generally bigger than intake valves because heat from combustion has expanded the air, and it needs more room to be able to exit at a similar rate that it came in.
Intake valves are usually smaller than exhaust valves because the air coming in hasn't been expanded by combustion yet.