The conduction of electricity is due to the flow of electrons. Therefore, in order for a substance to conduct electricity, mobile (free) electrons are required.
In the structure of diamond, all the four valence electrons of a carbon atom are used in forming the covalent bonds with other carbon atoms. Therefore, there is no mobile (free) electron present in the diamond to conduct the electricity.
In graphite, out of four valence electrons, three valence electrons of a carbon atom are used in forming the covalent bonds with other carbon atoms. Therefore, one valence electron of each carbon atom remains non-bonded in graphite. These non-bonded electrons help graphite conduct electricity.