There are three main types of rocks classified by how they are formed. Igneous rocks form from melted rock and can be either extrusive or intrusive. Extrusive igneous rocks cool quickly on the surface to form fine crystals like basalt and obsidian, while intrusive igneous rocks cool slowly inside the Earth to form larger crystals such as granite and gabbro. The size of crystals in igneous rocks depends on whether they cool quickly on the surface or slowly underground.