Molten rock is called "magma", "lava" (once it has erupted from a volcano), or simply a "melt".  As such a liquid cools down it eventually falls below some threshold temperature and begins to solidify, just as water placed in a freezer eventually turns to ice.

The exact nature of the solid can vary depending upon exactly how the melt solidifies.  To understand this we need to understand what is happening during cooling.

The melt originally forms as heat energy is added to rocks, causing the atoms in the constituent minerals to break their bonds and begin to move freely.  Cooling reflects the removal or dispersion of that heat away from the melt, allowing the atoms to move less freely, to gather closer together, and eventually to reform chemical bonds.

The first picture shows the result of rapidly pouring marbles into the bottom of a box sitting still on a table.  Notice that there is very little regularity to their arrangement.  The marbles were forced to come to rest as quickly as possible once they entered the box because there was no energy in the box beyond what they brought with them.  If we let the marbles represent atoms that have cooled down very quickly then their arrangement in the box represents a solid with little or no regularity to its atomic structure.  In other words, it is not crystalline.  A solid without a crystalline structure is not a mineral, but rather a GLASS.  There is one igneous rock with a glassy texture, called OBSIDIAN.  It forms when magmas cool so rapidly the atoms have no time to create crystalline structures.


The second picture above shows the same marbles poured into the box a second time.  This time the box was gently shaken as the marbles entered, but the shaking stopped as soon as all the marbles were in.  This example models the situation where a small amount of additional energy was present as the atoms solidified into rock.  In this case notice that there is more regularity to the arrangement, but with numerous places where the regularity "falls apart".  A rock with this type of atomic structure would be made of crystals where the regular arrangement exists, but the crystal sizes would be very small -- their edges would be where the regularity is disrupted.  An igneous rock with tiny crystals is called APHANITIC (from Greek roots "a"="not") and "phaneros" = "visible" because the crystal size is typically microscopic).  Several igneous rocks have aphanitic texture, forming when the melt barely has time to form small crystals.

The final picture above shows the same marbles in the same box.  In this model the box was gently shaken as the marbles were added, and continued to be shaken for a couple of minutes after all were present.  The additional energy gave all the marbles time to fit themselves together regularly.  A rock with this type of atomic structure would be made of large, obvious crystals.  Such a texture is called PHANERITIC (from the same Greek root as above, but without the "a", and so meaning "visible".  Many igneous rocks have such a texture.