The question can't be answered without knowing who made it, what caliber/gauge and whether it is a revolver, semi-auto, rifle or shotgun.
By the serial #
You are going to have to identify the model number to determine the age. Take the gun to a gun shop or gun smith for assistance.
Where did you get that gun?
1971
Serial number tables, if published
By the serial number.
The model number of the gun and make along with the serial number usually will determine the age of a gun.
This gun was made in 1952
1977
Find books on the maker.
The letter of the given serial number indicates the year the gun was manufactured. In this case, the gun was made in 1960.
This gun was made in 1953