Cretinism is untreated congenital hypothyroidism.
There are a couple of conditions that can lead to congenital hypothyroidism, including abnormal enzymes that make thyroid hormones, hypopituitarism.
If it is due to a maternal deficiency in iodine intake it is called cretinism.