A crankcase is the housing in a piston engine that surrounds the crankshaft. In most modern engines, the crankcase is integrated into the engine block.
Two-stroke engines typically use a crankcase-compression design, resulting in the fuel/air mixture passing through the crankcase before entering the cylinder(s). This design of the engine does not include an oil sump in the crankcase.
Four-stroke engines typically have an oil sump at the bottom of the crankcase and the majority of the engine's oil is held within the crankcase. The fuel/air mixture does not pass through the crankcase, though a small amount of exhaust gasses often enter as "blow-by" from the combustion chamber, particularly in engines with worn rings.
The crankcase often forms the upper half of the main bearing journals (with the bearing caps forming the other half), although in some engines the crankcase completely surrounds the main bearing journals.
An open-crank engine has no crankcase. This design was used in early engines and remains in use in some large marine diesel engines.