What keeps your skin cells in a human shape instead of them reproducing outwards indefinitely?

I remember in high school biology we were shown diagrams of what it looks like when someone gets a cut and the cells reproduce to fill the gap as it heals, but I'm having trouble understanding what makes them know they're done.
In a nutshell, cells have checkpoints during the cell cycle to make sure that the cell is ready to proceed with mitosis or cell division [4]. There are three cell cycle checkpoints, G1, G2, and M [4]. The G1, or first gap, checkpoint makes sure that the cell is big enough and contains enough nutrients to carry out mitosis [4]. The G2, or second gap, checkpoint bars the entry to the mitotic phase if certain conditions are not met, such as if the cell is not fully prepared for mitosis [2, 3]. Things like damaged DNA can prevent the cell from progressing [3]. The M, or mitotic, checkpoint is the last one and signals the start of mitosis [1, 4]. Once the M checkpoint has been passed, the cell cannot return to a previous phase [1, 4].
The key to why our skin cells don't keep reproducing indefinitely is because of mitosis. [1] Through mitosis, cells divide and produce two genetically identical daughter diploid cells. [1] The cells in our body, including skin, hair, muscles, and lungs, are called somatic cells, or non-reproductive cells. [1] These somatic cells, in turn, produce new cells to replace old or damaged ones. [1] The specific proteins (cyclins) in our body regulate how often cells divide - when to start and when to stop. [3] During fetal development, a different kind of collagen is made, which is why scars do not form during that time. [2] In adults, scar collagen remains after wounds heal, unless healing occurs during the fetal stage of life. [2]