去年 can be used in almost any situation. 昨年 is more formal and not good for casual conversation.
For example,
1) 去年、結婚いたしました。
2) 昨年、結婚いたしました。
2) is better because いたしました is a humble form but 1) is totally acceptable. On the other hand,
1) 去年、結婚しちゃった
2) 昨年、結婚しちゃった
1) is natural but 2) sounds a bit strange.
The same applies to:
昨日{きのう} vs. 昨日{さくじつ} (yesterday; the same kanji but read differently)
前年{ぜんねん} is a similar word and it means 'previous year'.
大統領{だいとうりょう}選挙{せんきょ}の前年は、株価{かぶか}が上がる。
Stock prices rise in a pre-presidential election year.
前年 is often used to compare a certain year with the previous year.
前年比{ぜんねんひ} 50%増{ぞう}
Up 50% over the previous year
Without reference to another year, 前年 means 'last year' and it is used almost always to compare 'last year' with 'this current year'.
1) 息子が生まれる前年に、結婚しました。(I got married in the year before my son was born.)
2) 前年、結婚しました .
1) is natural. 2) sounds incomplete because it doesn't compare anything or specify the reference year.