When 年前 stands alone, it usually means 'before Spring Festival' - the busiest travel period in China (春运). When preceded by a number (两年前, 十年前), it simply means 'X years ago.'
culture
The period before Chinese New Year is when hundreds of millions of migrant workers travel home - the largest annual human migration on Earth, called 春运.