A quantum well is a potential well with discrete energy levels, formed when a thin layer of one semiconductor material is sandwiched between two layers of another material with a larger bandgap. This structure confines the motion of charge carriers (electrons and holes) to two dimensions, resulting in quantized energy levels.