If you joined the Stormcloaks, it will be made available after you capture Fort Neugrad.
If you joined the Empire, it will be made available after you sack Windhelm (i.e. complete the line).
In both cases, it is highly advisable to complete Blood on the Ice first, in order to avoid bugs that can break said quest.
I didn't do the "Blood on the ice" quest then went on to do the whole civil war quest . . .
now I can't buy Hjerim at all ~ the steward just keeps saying they have a house available but it needs clearing up first
I have permission from the jarl to buy and the steward agrees to sell to me but only after the house is cleared up
but you only get the quest (blood on the ice) after the fourth visit to Windhelm [SPOILER {
from a guard in the graveyard at night}]
now it's too late for me to go and do the quest so i wont be able to make the purchase ~ it's a bad glich as it is supposed to be the best house to buy :[
so I'd say that doing blood on the ice is a must not advisable ~ each game is a bit different though so have a go anyway ~ but I've read somewhere that if you manage to buy it without doing the blood on the ice questline that even after you decorate the place out you still have the blood splats on the wall.
interested to find out how you get on.