My wife and I were just talking last night about this over dinner. We understand that, even today, not everyone eats breakfast/lunch/dinner, but it does seem to be the standard meal routine most people plan around. When did this routine emerge? Do we even know?
I am giving this from an American point of view; I don't know if other countries were affected the same way by the industrial revolution. Early American colonists ate their main meal, dinner, in the middle of the day. It was eaten in the early afternoon, anywhere from noon to 3pm. Breakfast and supper, if they were eaten at all, were much smaller, lighter affairs that often consisted of cold leftovers from dinner or unheated snack-like foods. Both were often eaten hurriedly, just before going out to work in the fields or bedding down for the night. There were no set times for breakfast and supper because people's working and sleeping schedules were closely tied to the timing of the rising and setting sun, which changes throughout the year. Dinner was the time when most, if not all of a person's daily calories were consumed. This practice was inherited from England, where many of the early colonists came from. It actually lasted longer here than it did in English culture, because the industrial revolution changed England's working and eating habits quite a bit earlier than it did ours.
There were several reasons for this traditional eating schedule: Most families lived on farms, and coming inside during the hottest part of the day in spring and summer was beneficial. Farming involved back-breaking labor, and a big meal was needed in the middle of the day in order to refuel for the second half. Women needed to get the day's cooking done before the sun went down, because there was little artificial lighting. Candles, lamps and fuel were expensive, and cooking in the dark was difficult and dangerous. Same went for washing up afterward.
The industrial revolution started bringing people from farms to cities, and having a large midday meal become impossible. People worked all day in factories and couldn't get back home again for a home-cooked meal. Dinner then started to be pushed back later and later, to be eaten when workers came home. Indoor lighting became cheaper and more advanced during this era, so it was no longer as dangerous for women to be cooking after dark. Also, when people lived on farms, they tended to work together all day long as one economic unit, and could interact with each other throughout the day. When they began living in urban environments, families spent the day separated from each other. Dinner became a special time when the whole family assembled together, to converse and bond.
During the colonial period, many English colonists looked askance on Native American eating habits, misinterpreting them and judging Indians as alternately slothful and gluttonous. Most tribes survived at least partially on hunting and gathering, and they ate randomly, whenever hunger struck them. Meals weren't really a thing and when food was eaten it was often quick, simple and unheated, and Indians went through periodic episodes of feasting and fasting as opposed to following a strict daily schedule of one large meal and one or two smaller meals. In a number of the Eastern Woodland tribes fasting was seen as an important way to strengthen your discipline and your physical body, and was regularly practiced in order to help them survive times when fasting was made necessary by long hunting trips, war, or seasonal shortages. On the other hand, when Indians came back from hunting trips with large amounts of game, they would often feast, everyone eating huge amounts of food over the next day or two. The attitude that colonists had towards Native Americans helped to entrench their belief that set mealtimes were a sign of civilization, and hence, superiority.
During the Victorian era, eating meals took on moral implications. Snacking between meals was reviled and showed a lack of moral fiber. Meal times were expected to be strictly adhered to, alcohol was often discouraged, and sugary treats like pastries were seen as agents of temptation. Three square meals a day were seen as part of a healthy, moral lifestyle. They also transformed breakfast from a casual, unheated bit of leftovers to a substantial meal of processed cereal grains, ostensibly for health reasons.
During the Industrial Revolution and after, mealtimes differed depending on social class. For many years how late you ate your main meal was a sign of how wealthy you were. The upper class could afford artificial lighting going way into the night and did not need to conform their eating schedule to seasonal farm work. Lavish, late night dinners were a common pastime for the affluent, where they could converse, mingle and arrange social and business contracts. The working and middle classes ate dinner earlier because they needed to go to bed so they could rise early the next morning. The tradition of having dinner at 5 or 6 pm among middle class Americans stems from this.
The standard 3 meals a day is currently waning in American culture, due to the nature of modern work schedules and the food advertising industry. Snacking has become really common, and many of us snack all day long instead of eating 3 squares. This, of course, comes with its own set of problems, but that's not a subject for this subreddit.
Much of this information comes from the book Three Squares: The Invention of the American Meal by Abigail Carroll. It's heavily researched and addresses exactly the question you asked, with a detailed history of American eating habits for the last 4 centuries. It's a really good read too!