"Longevity" is a general and imprecise term. It means "living for a long time." "Aunt Edna was blessed with longevity and lived to be 104 years old; Uncle Bill was not and died in his forties."
"Life expectancy" is a precise term with a mathematical meaning. It is a term used by "actuaries," people that calculate premiums for life insurance companies. It means the average number of years that a large, specific population of people lives. For the entire population of Japan, the life expectancy at birth is 83.7 years; for the entire world, 71.0 years