Crystals grow in different shapes because of the internal symmetry of the crystal and the growth rate along the direction of the crystal. The arrangement of the atoms in a crystal is called a lattice. In a perfect environment, the crystal faces that form reflect the internal atomic lattice.
In imperfect environments, a crystal may grow faster or slower along a particular axis, which results in a deformed crystal compared to what the atomic lattice predicts. For example, if a crystal normally grows along all three directions equally, it would be a cube. If something interferes with the growth along one direction, it ends up being a rectangular prism rather than the predicted cube.
Most crystals found in nature are imperfect in that they have dislocations and defects. Dislocations can be either an extra plane of atoms that do not run the entire length of the crystal or a twist in the crystal that causes a portion of the crystal to align with a different plane lattice structure than the one with which it started. Defects can be the result of missing atoms, an atom that replaces what would have normally been in that location, and a small interstitial atom that is between the normal atom patterns of the crystal. Interstitial atoms are much smaller than the atoms in the rest of the lattice, as they fit between the other atoms.