Smoke from the fire attack on the Sikh temple spewed into the building, endangering people inside, the High Court in Edinburgh heard last month.
He later confessed to the crime, telling police officers he wanted to watch the buildings burn down.
Johnson, 49, admitted two charges of wilful fire-raising, aggravated by religious prejudice, on August 28.
Returning to the court for sentencing this week, judge Lord Boyd described Johnson’s actions as “reckless and wicked”.
He said the defendant appeared to have a “grudge” against religion or religious authority in general, rather than a prejudice against one particular group.
The court had earlier heard that on the evening of 27 August, Johnson bought a container and fuel worth £3.51 from a local petrol station.
A worshipper travelling to the temple in the early hours of August 28 saw fire had taken hold on one side of one of the doors.
He raised the alarm and the fire service sent 11 firefighters who brought the blaze under control.
Hours later, the caretaker at Leith Methodist Church noticed a smell of petrol and burning, but found the front door had not been seriously damaged by a fire. He later contacted police after hearing about the incident at the temple.
CCTV footage from the area around the church between 12.03am and 12.13am showed Johnson approaching the church door, before a flash of light appeared.
He returned on two further occasions during that time to light more paper and throw it towards the door before running away.
Asked about his involvement in the two fires, after his arrest he immediately told officers: “I did it," the court at his first hearing.
Advocate depute Alan Cameron told the court: “The accused was asked as to his motivation for the fires and stated that he was looking to make a political statement, but would not provide further details. When asked whether this was religiously motivated he stated that he has no issue with any particular religion but his issues are with religion and God in general.”
Sentencing Lord Boyd said: “What is clear is that you seem to have some sort of grudge against religion or religious authority and decided to take it out on two nearby religious buildings. You told police officers that you were confident that no-one was in the building and that fire officers would not be at risk because of their training. You were of course wrong about people being in the building and your actions did put people at risk.
“It is clear from what I can glean about these offences that they were motivated by a grudge against religion or religious authority in general rather than prejudice or bigotry against any one group. Indeed you appeared unaware of the religious denomination of the buildings themselves.”
Speaking after the hearing, Detective Inspector Grant Johnston, of Gayfield CID in Edinburgh, said: “Paul Johnson showed absolutely no concern for the safety or wellbeing of those in or around either place of worship when he started these fires.
“As a result of a swift police investigation, Johnson was quickly traced and arrested in connection with the fire and has now been given a custodial sentence.
“We treat all hate crime incidents with the utmost seriousness and whenever such offences occur, we will conduct a thorough inquiry to bring those responsible to justice.”
Additional reporting by Press Association