I have read about the punishment of the grave (barzakh) and then later in Hell after Judgement Day.
My query is how do these two punishment differ? Will the soul be punished twice for the same sin?
As far as I know, there is no specific verse or hadith that directly talks about this.
However, it is the reasonable and logical understanding that Allah will not punish the same sins twice. This is because punishing the same thing twice goes against the very essence of justice which is about equal payback.
As Allah says in the Quran about punishment:
That is for what your hands have put forth [of evil] and because Allah is not ever unjust to His servants." (8:51)
However, it may be possible that the punishment of one sin is not completely fulfilled in the grave. In that case, it makes sense that Allah may finish the punishment in Jahannam.