Casey James Fury also was ordered to pay $400m in restitution.
Fury, 25, pleaded guilty to setting the 23 May fire while the submarine was undergoing a 20-month dry dock overhaul at Portsmouth Naval Shipyard at Kittery, Maine.
The civilian painter and sand blaster told authorities that he needed to go home because he was suffering from an anxiety attack and had no more holiday or sick leave.
He said he never envisioned such extensive damage when he used a lighter to set fire to a plastic bag of rags that he left on a bunk in a state room.
The blaze quickly grew into an inferno spewing superheated smoke that billowed from hatches.
It took 12 hours for more than 100 firefighters to save the submarine.
About three weeks later, Fury set a second fire outside the crippled sub, again because he wanted to go home because of anxiety. That fire caused little damage. He pleaded guilty to two counts of arson in November.