A Graveyard shift is a great phrase that native speakers all know.
First of all, a “shift” in this sense, means one time going to work. If you work 9:00 am to 5:00 pm Monday to Friday, then you have 5 eight hour shifts per week.
Not all shifts are during the daytime. Waitresses often work an evening shift for example.
Some companies are 24/7 (open all the time). There are usually 3 shifts for these companies. People who work the “morning shift” (8:00 am to 4:00 pm) then people who work the “afternoon shift” (4:00 pm to midnight) and people who work the “graveyard shift” (midnight to 8:00 am) People who work in manufacturing or in 24/7 fast food restaurants like McDonald’s sometimes need to work the “graveyard shift“.
A “graveyard” is the field where they bury people after they have died. It’s a quite and kind of “scary” place. This is where that shift got its name. It’s kind of quite and scary at night.