The aim of our study was to conduct a national-wide longitudinal follow-up investigation to elucidate the association between prematurity, small for gestational age (SGA), and later development of atopic diseases in pediatric population. Research data was obtained from Taiwan’s National Health Insurance Research Database (NHIRD). Our cohort included infants born between 1 January 2004 and 31 December 2019 with exclusion of death during follow-up period and multiple births. Children born prematurely or SGA were identified as study cases and those born term and appropriate for gestational age (AGA) as controls. Data was then analyzed and adjusted for covariates. A total of 1,758,460 infants comprising 914,713 male and 843,747 female were included in the study. Prematurity was associated with atopic rhinitis (AR) (HR, 1.03, male and HR, 1.03, female), asthma (HR, 1.19, male and HR, 1.17, female) and protective against atopic dermatitis (AD) (HR, 0.94, male and HR, 0.95, female) in both male and female AGA groups. SGA were not associated with atopic diseases in term infants. Further investigations are required to clarify the underlying mechanisms and establish the causal relationship of the issue.