Stacks up to
Rocks are generally obtained by mining Boulders with a Pickaxe, but they can sometimes be found lying on the ground. They can also be obtained by deconstructing some structures, such as a Fire Pit or a Rundown House, with a Hammer or Deconstruction Staff.
Underground, Rocks can be mined from Stalagmites or dropped by Rock Lobsters. They also fall from the ceiling during Earthquakes. Additionally, they can drop from Relics after smashing them. Slurtles and Snurtles will attempt to eat Rocks, and Slurtles will attack a player holding Rocks if there are no minerals on the ground for them to eat.
Reign of Giants
In the Reign of Giants DLC, Moleworms will eat any Rocks lying on the ground. However, their Burrows can be used to renew rocks easily, along with other minerals (excluding Marble and Gems). When dug up using a Shovel, the burrow drops either Rocks, Flint, Nitre or a Gold Nugget. The Moleworm residing there goes off to make a new Burrow. Also Rocks can be obtained by mining Mini Glaciers.
Rocks can be used to repair Stone Walls.