From Nookipedia, the Animal Crossing wiki
A Gyroid (ハニワくん, Haniwa-kun) is a special item that sits outside the player's house in Animal Crossing. When the player wants to quit, they save their game progress by talking to the Gyroid: if they do not save, Mr. Resetti will punish them with a long lecture the next time they play the game, about how they should not reset the game (or turn off the game without saving). When the player buys a house from Tom Nook, he throws in the Gyroid free, and will explain what it does to the player.
In Animal Crossing: Wild World, Animal Crossing: City Folk and Animal Crossing: New Leaf, Nook will not give the player a Gyroid outside their house, instead (in Animal Crossing: Wild World and Animal Crossing: City Folk) the highest floor of the player house is a bedroom where the player can jump into their bed and save progress. Also, in City Folk, there is an Auction House in the City owned by a Gyroid named Lloid.
A Gyroid's owner can teach it messages to repeat when conversing with other players or visitors. In Doubutsu no Mori e+, the player can set a message to appear at a certain time of the day.
The player can place up to four items in the Gyroid for it to sell, give away, or display to other players or visitors. This is the easiest way to exchange bugs and fish with other players as they may not be placed in letters.