The Bible does not specifically say how old he was but it does call him a "youth," which probably means about 12-16 years old.
David did not kill Goliath in a city, but rather in a field known as the Valley of Elah.
Goliath.
There is more than referance to Goliath in the Bible, but the main story of David and Goliath is found in 1 Samuel 17.
Goliath
1 Samuel 17(NIV Version I'm not sure about the others)
Goliath was the giant who fought against a young King David in the Old Testament of the Bible. Goliath's mother was David's mother's sister in law, Orpah.
Goliath was a Philistine. (Specfically, he was from the city of Gath, a Philistine city-state.)
Goliath is played by nelson who is voiced by Nancy Cartwright.
1 Chronicles 20:5 lists Lahmi the brother of Goliath. 2 Samuel 21:19 records the death of "the brother of Goliath," but does not give a name. There are no other mentions of brothers of Goliath in the KJV bible. Although, the bible does speak about Goliath having four sons. (2 Samuel 21:22) "These four were born to the giant in Gath..."
When David the shepherd boy and the giant Goliath fought each other in valley , it is very possible that as david was a boy then and a shepherd by profession he could have been 17 years old at the most.
The Bible doesn't say.