Such an orderly arrangement needs to fill space efficiently and keep a charge balance. Since the size of atoms depends largely on the number of electrons, atoms of different elements have different sizes. Each Na is surrounded by Cl and each Cl is surrounded by Na. The structure of minerals is often seen in the shape of crystals. Crystal structure depends on the conditions under which the mineral forms.
Polymorphs are minerals with the same chemical composition but different crystal structures.
At high T atoms vibrate more, and thus distances between them get larger. Crystal structure changes to accommodate the larger atoms. At even higher T substances changes to liquid and eventually to gas. Liquids and gases do not have an ordered crystal structure and are not minerals. Increase in P pushes atoms closer together.