How does Yir'as Hashem add days?
R. Yonah: Worries weaken a person and hasten death. Fear of Hashem, worry about sins and lack of Avodas Hashem, they do not shorten days, rather, increase them - "Yamim Al Yemei Melech Tosif Shenosav Kemo Dor va'Dor" (Tehilim 61:7). I.e. it will add two generations, like double his years. Hashem's addition is greater than the principal (Bereishis Rabah 61:4) - "v'Hosafti Al Yamecha Chamesh Esre Shanah" (Melachim II, 20:6), and beforehand Chizkiyah ruled only 14 years.
Malbim: Here it mentions days, to teach that in addition to longer life, his days will be of good and serenity.
What shortens Resha'im's years?
R. Yonah: Based on nature, delicacies establish (strengthen) the body. Resha'im who indulge to fulfill their desires, and they break the yoke of Shamayim and snap the ropes. The sins will shorten the days proper for them.
Malbim: This is a punishment from Hashem. "Shanim" implies years of pain, in addition to shortened life.