Fetal brain development is an important determinant of neuropsychological performance in children. Any alterations in the intrauterine environment at different stages of pregnancy, such as maternal metabolic disorders, can lead to the development of chronic conditions in the offspring. Therefore, maternal diabetes, especially gestational diabetes mellitus, is an important factor in the development of pathological changes, such as miscarriage, fetal macrosomia, or neurodevelopmental disorders. During pregnancy, the hyperglycemic intrauterine environment adversely affects fetal brain development. A growing body of scientific research indicates that prenatal environmental factors, by affecting fetal brain development, can contribute to the appearance of autism spectrum disorders. According to the latest estimates from the International Diabetes Federation (2021), approximately 21.1 million live births worldwide (16.7%) have been affected by some form of hyperglycemia during pregnancy. The condition is more prevalent in low- and middle-income countries, where access to obstetric care is limited. The following factors have been identified as potential risk factors for gestational diabetes: advanced maternal age, overweight and obesity, family history of diabetes, and any form of diabetes. The purpose of this review is to summarize recent studies evaluating the effect of prenatal and maternal risk factors such as maternal pre-pregnancy diabetes, gestational diabetes, and obesity on the risk of developing autism spectrum disorder in offspring.