Valencia Ngobeni, now 20 but 19 at the time of her arrest, was sentenced on Monday to five years in prison, wholly suspended, and three years correctional supervision, the court official said.
Ngobeni was arrested on April 5, two days after her 16-month-old son was found wandering along the N1 highway near the Grasmere off-ramp.
The boy narrowly escaped being hit by a truck while walking along the busy road.
In July, Ngobeni pleaded guilty and was convicted of a charge of child abandonment and attempted murder.
In a separate case on Thursday, Nyeletsi Sithole was sentenced to an effective 10 years in prison for two counts of child abandonment and one count of fraud.