Cells can be grown outside the body by maintaining them in conditions that mimic the physiological environment (e.g. humidity, pH, nutrient composition, temperature). Typically, cells from mammals can be cultured for short periods of time before they stop growing due to natural ageing (senescent) programs; these are called primary culture. It is also possible for cells in culture to bypass these programs so that they can be cultured for very long periods of time; these are called immortalised cell lines.
https://www.thermofisher.com/uk/en/home/references/gibco-cell-culture-basics/introduction-to-cell-culture.html