Praise be to Allah, and may peace and blessings be upon the Messenger of Allah.
The continuous punishment of the grave is for the disbeliever and hypocrite. As for the sinful believer, he may be punished in his grave because of some of his sins, and then the punishment may cease.
It is authentically reported in Sahih al-Bukhari and Sahih Muslim from Ibn Abbas, may Allah be pleased with him, that the Prophet ﷺ passed by two graves and said:
“Indeed, they are being punished, and they are not being punished for something that was difficult to avoid. As for one of them, he did not protect himself from urine; and as for the other, he used to spread malicious gossip.”
This indicates that the punishment of the grave may also befall a sinful Muslim, and is not restricted to disbelievers.
Shaykh Ibn Uthaymeen, may Allah have mercy on him, said that the continuous punishment of the grave is for the hypocrite and disbeliever, whereas a sinful believer may be punished in his grave, as indicated by the hadith of the two graves.
And Allah knows best.