It is narrated from Imam Sadeq (AS) who said: The lifetime of people due to (their) good deeds are longer than their destinies in life. On the other hand the deaths of the human beings are faster due to their sins than their destinies. Meaning, in general deeds will have influence on the lifetime of the human being. Good deeds will increase the lifetime of people who carry out those good deeds. And in comparison the lifetime of those who commit sins are shortened [1].
[1] Beharul Anwaar, Vol. 5, page 140.
source : Shafaqna