We can never take one quote from Scripture, in isolation, to decide on what these eternal truths mean.
When we die, our souls do go straight to judgement, but it is an individual judgement, also called the particular or personal judgement. We are judge by God, based on how much we loved and served Him.
The opening up of graves is referring to the General Judgement, when our souls will be re-united with our bodies, and all who ever existed will know who God is, and will be judged ‘in public’, so to speak, of all un-repented sins. This was why Jesus told the story of the sheep and the goats.
Until this time of General Judgement, which will be at the end of the world, our individually-judged souls will be in one of three states/places - Heaven (for the completely pure of heart), Purgatory (those undergoing purification) or Hell (those who finally, and obdurately, chose against God). These states/places will be for our souls alone.
After the General Judgement, our souls will be united with our renewed bodies, to be in either Heaven or Hell.