Lee McKitterick, 36, raided his grandmother's bank account of more than £5,000 by making withdrawals from cash machines.
Prosecutor Harry Hadfield told Durham Crown Court McKitterick was temporarily living with his grandmother in the Seaham area when the thefts happened last November.
"She had a cash card with the account but did not use it," said Mr Hadfield.
"She was not confident with cash machines, so she was in the habit of visiting the bank to withdraw money to pay bills and check the balance.
UPDATE: Part of Wessington Way remains closed and repairs underway after burst pipe causes travel chaos
Fundraiser to be held in memory of Sunderland businessman who died following 'freak accident'
'Like a steam roller' - watch workers describe 'scary' scenes as reports of ground tremors and houses shaking lead to evacuations
Dad of Sunderland AFC fan who took his own life appeals for donations of football equipment as he prepares to launch charity in son's name
Firefighters ramp down operation after large allotment fire in Easington Lane
"The card was hidden, or so she thought, the defendant having taken money from her in the past.
"Out of the kindness of her heart she did not report those losses.
"The bank thefts were discovered when she checked the balance and found it was £1,200 when she was expecting it to be more than £6,000.
"In total, £5,692 had been stolen."
The court heard most of the money was withdrawn in £200 amounts from a cash point at ASDA in Seaham.
Police examined CCTV footage from the cashpoint which showed McKitterick making the withdrawals.
Lloyds Bank was commended by a judge for refunding the woman's money, even though the bank could not be held responsible for the thefts.
McKitterick, of Glencoe Square, Sunderland, admitted fraud in November last year, and he admitted being in breach of a suspended sentence.
"The suspended sentence was imposed in October for a burglary at a house in Sunderland," Mr Hadfield told the court.
David Callan, defending, said there was little mitigation in the case.
"The reasons for the offending can be summed up in two words" added Mr Callan. "Cocaine and heroin."
"Mr McKitterick had got into debt over drugs, and he was being pressed for payment.
"He cannot remember when he last worked, his life has been effectively ruined by drugs.
"In the cold light of day, he is disgusted with the way he behaved.
"He pleaded guilty, and he has shown willingness to seek help with his drugs problem while in prison."
Judge Christopher Prince jailed McKitterick for 34 months.
The judge told him: "Anyone hearing of this case cannot be anything other then dismayed to hear of such mean offending.
"Your grandmother had offered you sanctuary, yet you repaid that kindness by stealing from her.
"These were her life savings that she hoped to pass on to her children.
"You commenced this course of conduct shortly after you were given a chance by way of a suspended sentence for burglary.
"It is clear you had no intention of stopping offending.
"It is heartening to hear Lloyds Bank refunded the money, even though they could not be said to be at any fault for the thefts."