At the moment Jesus died, as Matthew 27:52 tells us, "The tombs were opened, and many bodies of the saints who had fallen asleep were raised." Most of our graves today are six-foot holes in the ground in which we put a sealed casket with the body of our loved one. Then we fill the hole with dirt and place a tombstone above it. The graves that are spoken of in this verse, however, were most likely rock tombs hewn into the side of a hill. These graves were sealed by large stones rolled in front of the entrances.
Whose graves were opened at the moment Jesus died? Only the graves of the saints. No unbelievers' tombs were opened.
Why were these graves opened? Well, it might seem simplistic, but the graves were opened so that dead believers could exit their tombs after they were raised to life.
And notice the timing of the resuscitation of these dead saints: They did not rise from the dead until after the resurrection of Jesus. Matthew 27:53 says, “And coming out of the tombs after His resurrection they entered the holy city and appeared to many.”
So these graves were opened on Friday at 3pm, but the dead weren't raised until (at least) Sunday morning. From Friday until Sunday anyone could have seen that the graves were opened, but no one would have attempted to seal them back up during that time because of the Sabbath.
The reason these graves were opened (and remained opened) at the moment of Jesus' death was a sign that death has been abolished.
Death is the penalty of sin. This penalty has been abolished. No obstacle stands in the way of your resurrection. Nothing can stop God from transforming you into the image of Christ.
“Our Savior Christ Jesus...has abolished death and brought life and immortality to light through the gospel.” (2 Tim. 1:10)