In diamond each carbon atom is joined to four other carbon atoms by strong covalent bonds. The atoms form a rigid three-dimensional structure, with each atom at the centre of a tetrahedron of four neighbours. Carbon atoms have four outer electrons, and in diamond all four are used in bonding, so there are no free electrons.
In graphite each carbon atom is joined to only three others. The atoms form flat layers made of hexagonal rings. The atoms in a layer are held by strong covalent bonds, but between the layers there are only weak forces, so the layers can slide over each other.
Each carbon atom in graphite uses three outer electrons in bonding. The fourth outer electron is delocalised: it is free to move along the layer.