A handgun is a gun small enough to be carried and used in one hand.
While a two-handed aiming posture may be optimum for most firearms, including handguns, if the gun is not designed to be usable in a single hand, it is not a handgun.
Two main designs are pistols and revolvers, however, single-shot handguns are also available.