Atomtronics is an emerging interdisciplinary field that seeks to develop new functional methods by creating devices and circuits where ultracold atoms, often superfluids, have a role analogous to that of electrons in electronics. Hysteresis is widely used in electronic circuits-it is routinely observed in superconducting circuits and is essential in radio-frequency superconducting quantum interference devices. Furthermore, it is as fundamental to superfluidity (and superconductivity) as quantized persistent currents, critical velocity and Josephson effects. Nevertheless, despite multiple theoretical predictions, hysteresis has not been previously observed in any superfluid, atomic-gas Bose-Einstein condensate. Here we directly detect hysteresis between quantized circulation states in an atomtronic circuit formed from a ring of superfluid Bose-Einstein condensate obstructed by a rotating weak link (a region of low atomic density). This contrasts with previous experiments on superfluid liquid helium where hysteresis was observed directly in systems in which the quantization of flow could not be observed, and indirectly in systems that showed quantized flow. Our techniques allow us to tune the size of the hysteresis loop and to consider the fundamental excitations that accompany hysteresis. The results suggest that the relevant excitations involved in hysteresis are vortices, and indicate that dissipation has an important role in the dynamics. Controlled hysteresis in atomtronic circuits may prove to be a crucial feature for the development of practical devices, just as it has in electronic circuits such as memories, digital noise filters (for example Schmitt triggers) and magnetometers (for example superconducting quantum interference devices).