If magma makes it to the surface it will erupt and later crystallize to form an extrusive or volcanic rock. If it crystallizes before it reaches the surface it will form an igneous rock at depth called a plutonic or intrusive igneous rock.