The important role of the gut microbiome in maintaining human health has necessitated a better understanding of the temporal dynamics of intestinal microbial communities as well as the host and environmental factors driving these dynamics. Genetics, mode of birth, infant feeding patterns, antibiotic usage, sanitary living conditions and long term dietary habits contribute to shaping the composition of the gut microbiome. This review focuses primarily on diet, as it is one of the most pivotal factors in the development of the human gut microbiome from infancy to the elderly. The infant gut microbiota is characterized by a high degree of instability, only reaching a state similar to that of adults by 2–3 years of age; consistent with the establishment of a varied solid food diet. The diet-related factors influencing the development of the infant gut microbiome include whether the child is breast or formula-fed as well as how and when solid foods are introduced. In contrast to the infant gut, the adult gut microbiome is resilient to large shifts in community structure. Several studies have shown that dietary changes induce transient fluctuations in the adult microbiome, sometimes in as little as 24 h; however, the microbial community rapidly returns to its stable state. Current knowledge of how long-term dietary habits shape the gut microbiome is limited by the lack of long-term feeding studies coupled with temporal gut microbiota characterization. However, long-term weight loss studies have been shown to alter the ratio of the Bacteroidetes and Firmicutes, the two major bacterial phyla residing in the human gastrointestinal tract. With aging, diet-related factors such as malnutrition are associated with microbiome shifts, although the cause and effect relationship between these factors has not been established. Increased pharmaceutical usage is also more prevalent in the elderly and can contribute to reduced gut microbiota stability and diversity. Foods containing prebiotic oligosaccharide components that nurture beneficial commensals in the gut community and probiotic supplements are being explored as interventions to manipulate the gut microbiome, potentially improving health status.