An vs. année

The French words 'an' and 'année' both translate to 'year' in English. However, they are not truly interchangeable because they are used in different situations and contexts.

An

The word 'an' is often used to count years or to refer to a specific point in time. It's more frequently used with a specific number (e.g. one year, two years), or when referring to a precise date. Usually, it implies a completed cycle.
J'ai vécu en France pendant un an.
(I lived in France for a year.)
Il y a deux ans, nous sommes allés en vacances en Espagne.
(Two years ago, we went on vacation to Spain.)
Dans un an, je serai diplômé de l'université.
(In a year, I will graduate from university.)

Année

The word 'année' means year as well but is used when emphasizing the duration of the year or when speaking abstractly about a year. It is largely used when talking about activities or experiences that happened over the course of the year(s). Année is also often used after words that do not denote precise quantities (like 'several', 'few').
Je suis allé en France pour l'année 2017.
(I went to France for the year 2017.)
L'année prochaine, je vais étudier à l'étranger.
(Next year, I will study abroad.)
Cela a été une dure année.
(It has been a hard year.)

Summary

In summary, while 'an' and 'année' both mean 'year', their usage depends on the context. The word 'an' is used primarily when counting years or referring to a specific time system, whereas 'année' emphasizes duration or is used more abstractly.