Igneous rocks are classified in a variety of ways:
1) by their origin: the place where molten material (magma or lava) crystallized below, or at or near the surface.
2) by their mineral components: based on ultramafic, mafic, intermediate, or felsic mineral composition.
Intrusive igneous rocks crystallize slowly in magma chambers or plutons deep underground and have a crystalline texture (visible crystals).
Extrusive igneous rocks when lava cools and crystallizes quickly at or near the surface.
3) by their appearance (color shades and rock textures) if the mineral crystals are too small to idendify, and if they preserve characteristics unique to how they formed.
mix of all of the above. Some volcanic rocks contain phenocrysts which are crystals that crystallize deep below and are carried to the surface and imbedded in extrusive igneous rocks, such as a porphyry.
Note there are a variety of igneous rock classifications that are much more technical than the simplified version presented here.
Click on images for a larger view.