Glen Hunt, from Conars Court in Londonderry, must spend 10 months in prison with a further 10 months on licence
The attack happened at his partner's home in the Shankill area of Belfast on 3 September last year.
A Belfast Crown Court judge described it as a "shocking incident".
The court was told that Hunt returned to his partner's home after spending the day watching band parades and drinking. Prior to going home, the father of three got into an altercation with his partner's brother, who he claimed assaulted him.
A prosecution barrister said Hunt returned in an "intoxicated and agitated" state.
Hunt's partner was upstairs, and while in the bathroom she felt a thud to her shoulder. A struggle between the couple then ensued, during which she was pushed into the bath. She them saw Hunt raise his hand, and he struck her twice with a hammer.
The barrister said the woman was able to get the hammer from Hunt, adding "the struggle came to an end when her grandson came into the bathroom".
She left with the toddler, reported the matter to police and later sought hospital treatment for two wounds. She required stitches for a cut to her forehead, and also suffered a chipped tooth and a wound to her lip.
Hunt handed himself in to police in Derry three days later, and during interview made the case that he had been assaulted by his partner's brother. He said that when he got home, his partner was on the phone with her brother and that he was "in fear".
He subsequently pleaded guilty to wounding the woman, and to possessing the hammer with intent to commit assault.
The court heard the hammer used was already in the house. It also emerged that while Hunt has a criminal record of 25 convictions, there were no convictions for violent offences.
A defence barrister said there was no history of domestic violence between the two, adding that when Hunt returned home drunk after being assaulted, he felt in fear.
Passing sentence, the judge said that the woman was traumatised by the attack, and "continues to feel the after-effects of what was clearly a shocking incident".
A 53-year-old man has been jailed for attacking his partner with a hammer in the presence of her three-year old grandson.