In highschool we are taught about Bohr's atom model and how electrons emit light/ photons when transitioning from a higher energy orbit to a lower energy orbit.
First question
Where does this phenomenon actually occur in real life? Is it referring to when the sun/ stars emit light? Is it referring to when objects are heated?
Visible light is a small part of the frequencies of the electromagnetic spectrum
The Bohr model was introduced in order to describe the visible spectrum absorption and emmision lines within the classical electromagnetic theory.
In classical electromagnetism, an accelerating charge would emit electromagnetic radiation, depending on the energy of the particle. The existence of atoms , i.e. with negaive electrons orbiting, like planets, around a positive nucleus could not be modeled in classical theory,because the negative electron would accelerate towards the positive nucleus and give a continuous spectrum of electromagnetic radiation. Also there could be no ions, as the electron would be absorbed. The experimental data gave absorption and emission spectra, and stable atoms.
The Bohr model solved the conundrum by postulating quantized angular momenta for the trajectories of the atoms. The theory of quantum mechanics developed a rigorous method of modeling the microworld of atoms and molecules.
Depending on the atoms of the material different color lines can be seen, and are used as explained in the other answers.
Second question
Is this the only way light is emitted?
No, as mentioned in the first paragraph, accelering charges also emit light, for example a spark gives off light, because of the acceleration of numerous free electrons , free in various ways ( rubbing, cathode ray tubes...)
Also, again because of accelerating charges in solids and liquids and gasses,due to the temperature, electromagnetic radiation of many frequencies come out , called black body radiation, as mentioned in an other answer. This covers a lot of frequencies, depending on the temperature of the material. The radiation of the sun is predominantly black body,though one can see the spectral component also.
Black body radiation is how light is mainly emitted by incandescent lamps, and how iron show red when its temperature is high ...