A pioneering study showed that the fine structure in the luminosity function (LF) of young star clusters contains information about the evolutionary stage (age) and composition of the stellar population. The notable features include the H-peak, which is the result of the onset of hydrogen burning turning pre-main sequence stars into main sequence stars. The feature moves toward the faint end of the LF, and eventually disappears as the population evolves. Another detectable feature is the Wielen dip, a dip at M_V ~ 7 mag in the LF first identified in 1974 for stars in the solar environment. Later studies also identified this feature in the LF of star clusters. The Wielen dip is caused by the increased importance of H- opacity in a certain range of low-mass stars. We studied the detailed structure in the luminosity function using the data from Gaia DR2 and PARSEC stellar evolution models with the aim to further our understanding of young stellar populations. We analyzed the astrometric properties of stars in the solar neighborhood (< 20 pc) and in various relatively nearby (< 400 pc) young (< 50 Myr) open clusters and OB associations, and compare the features in the luminosity function with those generated by PARSEC models. The Wielen dip is confirmed in the LF of all the populations, including the solar neighborhood, at M_G ~7 mag. The H-peak is present in the LF of the field stars in the solar neighborhood. It likely signals that the population is mixed with a significant number of stars younger than 100 Myr. The H-peak is found in the LF of young open clusters and OB associations, and its location varies with age. Our observations with Gaia DR2 confirm the evolution of the H-peak from 5 Myr up to 47 Myr. The fine structure in the luminosity function in young stellar populations can be used to estimate their age.