All crystals have a definite shape. For crystals to form, they need time and freedom. Sometimes an atom that doesn't match that of all the other atoms while forming a crystal gets mixed in with them. This is called a stowaway atom. It could be of a different color, or size.
Some gems are different colors because their molecules are different colors.
Crystal formations are formed by solutions. A crystal increases size by adding atoms to its surfaces. They can also be formed by hot molten lava. The lava cools, and crystals start to form. That is why when the lava cools we get rocks.