In Livin' Large, they can be made at the KraftMatic Woodworking Table. One of the spells in The Sims: Makin' Magic can temporarily bring a garden gnome to life as a gardening gnome, which will take care of plants.
In The Sims 2, The Sims 3 and The Sims 4, they can be bought as garden decoration. In The Sims 3, Sims can purchase (through buy mode) or find Sleeping Gnome McMulty.
In Nightlife, a guest may attempt to steal a gnome from the lawn, though not when the game camera is focused on them. If the gnome is stolen successfully, any Sim in the household can retrieve it, and it will appear in his/her inventory. Sims in the household where the gnome is being stolen from will yell at the thief if they witness the theft, although they do not appear to be able to stop it.
In The Sims 2 Castaway and The Sims 2: Pets, there is a gnome called "Shifty Sam the garden gnome". In reference to his name, Shifty Sam will appear in different places on the lot when kicked over and left alone long enough, similar to the Mysterious Gnomes of The Sims 3.
In The Sims 3: Pets, there are garden gnomes in buy mode which can summon animals to a lot. There is a gnome for cats, dogs, and wild animals.
In The Sims 4: Seasons, the Harvestfest holiday includes an activity called "Holiday Gnomes" where Sims can attempt to appease gnomes they find around their lot. If the outcome is good, gnomes may offer rewards; however, if the outcome is bad, the gnomes will come to life and start wreaking havoc on the lot, and must be kicked to stop their rampage.