Kneading does two things. First it mixes all the ingredients uniformly. You have to do this no matter what, but you only really have to do it enough to mix the ingredients.
If you keep kneading beyond the mixing stage, you are applying energy (which equals heat) to the yeast which makes it ferment, generating the tiny bubbles which make bread fluffy.
The yeast will ferment on its own, but kneading just accelerates that process.
Historically, dough was proved (left in a hot humid place) for about 18 hours allowing it to rise slowly in order to make bread.
In 1961 a process was developed in England called the Chorleywood Process. Essentially you work the heck out of the dough with high-speed mixers. The extra few minutes of high energy mixing applies heat to the yeast, which dramatically reduces the fermentation period required, allowing you to make bread much more quickly... at factory-type speeds. Factories can make bread in a couple of hours instead of having to prepare dough one day and bake it the next.
It is because of the way starch retrogrades. It does so in stages. The first stage needs between 1 and 2 hours, the second one a few days.
You have probably seen it more clearly in starch-thickened puddings: they thicken a bit on stovetop, but are only ready to unmold after a few hours, else they wuoldn't keep their shape. In a bread, the starch granules are the same way: right after baking, they contain too much moisture.
Sure, if you eat the bread right away, the aroma is very good. But the texture is problematic. It gets doughy and dense at the smallest amount of pressure. Tearing instead of cutting helps a bit. And if you are at home, eating with your family, go for it and eat the tasty still-hot bread. It is especially good with soft, low-gluten breads made with AP flour with the least amount of bran (50% milling grade or even less), my grandma would say that they "melt in the mouth" when they are hot. But if you serve bread slices to guests, or want to spread something on the bread, wait for its starch to set.
On a side note, the second stage of starch retrogradation is the reason why you should use day-old bread for crumbs for thickening, and the third stage is the one which makes bread inedible. But this goes too far away from the original question.
Best Answer
Giving a minimum time is not possible, because it depends on the size of the loaf, whether it is in a pan or not, and the ambient temperature of the location where it is cooling. In general, the recommendation is to cool the loaf to room temperature. If you are baking rolls, this might mean 30 minutes. For a larger loaf, it could be hours. At the risk of providing information captured in other questions...There is a process called starch retrogradation that takes place as the bread cools. This means that water absorbed by starches during the baking process is expelled at the molecular level, and evaporates. Cutting too soon means you risk a gummy textured bread. Next, cutting your bread too soon releases trapped steam, this could mean that your bread is drier, later. Finally, depending on the ingredients, flavor continues to develop as your bread cools. All of this is carefully explained here. I would also suggest that you don't want to shortcut this process. It takes a bit of effort to produce a good loaf at home. My guess is you've already planned ahead quite a bit. What you want is a loaf that has cooled to room temperature. Then you can heat it for your guests, as restaurants do.