There is No Punishment of the Grave
The whole concept of Judgement Day in the Qur'an revolves around judging whether a person deserves the eternal sentence of Hell or is eligible for the eternal bliss of the Gardens. There cannot be any punishment without first being judged. Just as in the world, we do not punish a suspect without trying him at the courts. The Day of Judgement is the day every man and woman will be judged before they are sent to their final abodes.
"Every soul shall have a taste of death: And only on the Day of Judgment shall you be paid your full recompense. Only he who is saved far from the Fire and admitted to the Garden will have been victorious: For the life of this world is nothing but the enjoyment of delusion." (Qur'an 3:185)
The Qur'an, revolving around some six thousand verses with the primary theme of Heaven and Hell, depicts no picture of a dead body being punished inside his grave prior to Judgement Day. A well versed believer in the Qur'an will certainly find this very absurd. God always makes a special point of the punishment of people who deny His path being deferred to the Hereafter after the Day of Judgement.
When you die, you return to a state of non-existence, exactly like how you were before you were born. In this state, no thoughts, memories, feelings, time, matter or space exist. Think of someone who has passed away in your life. This person has no feelings of time, thoughts, or awareness of matter or space like someone who is not yet conceived. He or she is non-existent right now. Though you are living your life, that person no longer knows there is a universe. From their last known perspective, they just breathed their last breath. In truth, they do not have a last known perspective, as from the perspective of non-existence, they never ever lived.
Before the Day of Judgment commences, the heavens and the earth will be destroyed. According to the Qur'an, the sound of a trumpet will reverberate through the earth twice. The first time it sounds, the destruction of the heavens and the earth will happen. On the second sounding of the trumpet, billions of people who have lived on earth since the beginning of humankind's existence to that day will be raised from their graves. This is the Day of Judgement (39:68-70).
During the period between your death and being raised again, there is bleak nothingness where you never existed. As stated, in this state, no time, space, matter, memories or feelings exist. God explains this state using the example of sleep by saying that waking up from sleep is 'like resurrection' (نُشُورًا - nushoora), which is the same word used for resurrection on the Last Day (see 25:40).
Death takes a person from living into a state of complete non-existence. He is re-assembled by God on the second blowing of the trumpet. To him, the moment his death occurred and the moment he woke up is a mere blink of an eye with no time in-between (therefore, even shorter than a blink), even though thousands of years may lie in-between. This is because there was no concept of time between death and Resurrection. God explains this as follows:
In this bleak nothingness of death, there is no punishment at all, as nothing exists from the perspective of nothingness. Punishment is metered out once the person is judged and the verdict of Hell is declared in the manner described in the Qur'an.
The bewilderment of disbelievers raised from their graves indicates that they did not experience anything in their graves. If they were experiencing punishment in their graves, they would not be bewildered by their restored state of living. They would also not be shocked by the realization that God's path is the truth:
This is the true understanding of death, Hereafter, and punishment as explained by God.
The verse above is a testification from the disbelievers who are brought to life in the Hereafter. They testify that the period before their birth on earth was of the same essence of non-existence as the period between their death and resurrection. We know this because the same words (أَمَتَّنَا - "to cause us to be dead") is used for both cases. Only in the two other cases did they feel and experience: life on earth, and the Hereafter. In other words, there were no feelings, time, space, matter, or any sensory perception associated with living between death and resurrection just like there were not any before conception on earth. This verse reinforces the description of the bewildered minds of disbelievers upon resurrection mentioned in verse 36:51-52, and that there is no punishment of the grave.