Graveyard and cemetery do not mean the same thing. From about the 7th century, the process of burial was in the hands of the Church (the organization), and burying the dead was only allowed on the lands near a church (the building), the churchyard.
The part of the churchyard used for burial is called a graveyard. As the population of Europe started to grow, the capacity of graveyards was no longer sufficient. By the end of the 18th century, the unsustainability of church burials became apparent, and completely new places, independent of graveyards, were devised. These new places were called cemeteries.
Cemetery comes from Old French cimetiere, which meant graveyard. The French word originally comes from Greek koimeterion, meaning 'a sleeping place'.
Bottom line, a graveyard is a type of cemetery, but a cemetery is usually not a graveyard.