Measuring the evolution of X-ray emission from pre-main sequence (PMS) stars gives insight into two issues: the response of magnetic dynamo processes to changes in interior structure and the effects of high-energy radiation on protoplanetary disks and primordial planetary atmospheres. We present a sample of 6,003 stars with ages [7 − 25] Myr in ten nearby open clusters from Chandra X-ray and Gaia-EDR3 surveys. Combined with previous results in large samples of younger ( 5 Myr) stars in MYStIX and SFiNCs star forming regions, mass-stratified activity-age relations are derived for early phases of stellar evolution. X-ray luminosity (L X ) is constant during the first few Myr, possibly due to the presence of extended X-ray coronas insensitive to temporal changes in stellar size. L X then decays during the [7-25] Myr period, more rapidly as stellar mass increases. This decay is interpreted as decreasing efficiency of the α 2 dynamo as radiative cores grow and a solar-type αΩ dynamo emerges. For more massive [2 − 7] M fully radiative stars, the X-ray emission plummets indicating lack of an effective magnetic dynamos. The findings provide improved measurements of high energy radiation effects on circumstellar material, first the protoplanetary disk and then the atmospheres of young planets. The observed X-ray luminosities can be so high that an inner Earth-mass rocky, unmagnetized planet around a solar-mass PMS star might lose its primary and secondary atmospheres within a fewseveral million years. PMS X-ray emission may thus have a significant impact on evolution of early planetary atmospheres and the conditions promoting the rise of habitability.