In crystalline materials, the atoms form periodic arrays. Due to the periodicity of the crystal lattice, the quantum wavefunctions of the electrons may be restricted to continuous but separate energy levels.

If one of these "bands" is partially filled, the material in question is a metal.

If the occupied band with the highest energy is filled with electrons, then the material is one of three types, depending on the energy difference between the highest occupied state and the unnoccupied state lowest in energy:
For a very large "gap," the material is an insulator.
For a very narrow gap consisting of one discrete energy level, the material is termed a semimetal.
If the bandgap is relatively small, the material is called a semiconductor.

A good working definition of a semiconductor follows:
A semiconductor is a material with a bandgap sufficiently small so that electrons may move into the upper band simply by absorbing thermal energy.

This provides some room for argument in defining whether a material is a semiconductor or not. This is actually intentional, since most people don't think of carborundum as a semiconductor, but at high temperatures silicon carbide is a functional semiconductor.