Hello there! I published recently on cookbooks in the 19th century so I hope this will help.
You will notice going through older cookbooks that times are never mentioned at all. In fact, before 1/~1850, many books did not include weighted amounts for the ingredients and rather said "a lot", "a little" or something similar. This was certainly due to the fact that your average cook would not have access to a watch nor a scale, which changed rather abruptly with the end of the 19th and beginning of the 20th century, where past luxury consumer goods like pocketwatches reduced dramatically in price. They were of course still expensive to the proles and peasants who still made up the majority population (in Germany specifically in my case, but also the rest of the world).
Now to your question: How did people know? Well, cooking is a multi-sense activity. Touch a piece of meat and a good cook can tell you whether it's medium or well-done. Mix around a stew and if the meat dissolves a little, it's completely cooked. Certainly, much of it boils down to experience, too. Cooking was, until the 18th century, learned mostly by oral tradition, often from mother to daughter or a professional cook to their protege. How exactly time was communicated between them we can only speculate, it would be interesting to look at, say, the oral history of farming and how they communicated time-frames without watches and minutes.
But for most of human history, one should not forget, people did not have a scientific proof for germ theory. That means people, depending on culture and time, might not have been aware of the dangers of bacteria and pathogens in uncooked meat. They did develop many methods to counteract this process however: Curing, pressing, fermenting meat and other things. So cooking time, aside from influencing the taste, might not seem to have any importance to them.
This comment discusses why recipes from “ancient” times don’t have cook times.
The other top level comment in that thread may also interest you as it discusses the move from “vague” recipes to specific ones with timers and ingredient measurements.