The stability is a key issue to design superconducting magnets and to ensure their proper exploitation. This is the case of the imminent operation of the Large Hadron Collider (LHC) accelerator, which requires a good knowledge of the stability margin of its magnets with respect to beam induced thermal perturbations. In this paper a thermal model to predict the response of a superconducting cable to a heat deposition is presented. The model includes a detailed description of its most relevant parameter: the heat transfer between the strands of the cable and the surrounding helium. The different helium phases which may appear during a thermal transient are considered, i.e. He II, He I with formation of a thermal boundary layer, nucleate boiling, film boiling and gaseous phase, as well as the transitions among them. The dependence of the stability margin on the parameters of the model is discussed. Finally, the stability characterization of the LHC cables is presented with respect to the duration of the perturbation (ranging from tens of microseconds to tens of seconds) and to the magnets operating parameters.