Igneous rocks are those rocks that have cooled from magma either deep within the Earth or near or on Earth's surface.
The depth at which a magma cools will have a number of effects on the resulting rock. If magma cools deep within the Earth, or intrusively, the surrounding material will insulate the magma, much like a comforter insulates a person on a bed. This will cause the magma to cool at a much slower rate and allow individual mineral crystals to grow larger and larger. If, on the other hand, a magma cools on or nearer to the surface, or extrusively, there will be less insulating material and therefore the magma will cool more rapidly. This will result in smaller mineral crystals.