Goliath is a figure of debatable historicity appearing twice in the "Books of Samuel".
His first and most famous appearance is in Chapter 17 of the first Book of Samuel. There Goliath is mentioned as a Philistine from the city of Gath. His home-city was the one closest to the areas of the Israelites and appears frequently in the "historic accounts" of the Bible. According to this appearance Saul, King of Israel led his troops in facing the Philistines at the Valley of Elah. Goliath was the champion of the Philistines and would twice a day challenge the Israelites to send out a champion of their own. The intend was to have a duel of champions which would resolve the conflict.
Neither Saul himself nor his active soldiers dared face Goliath in a duel. Forty days later, David visited the camp to bring additional supplies for his older brothers who were serving there. Learning of the challenge and a promised reward by Saul, David volunteered. He refused to wear armor in combat and chose his sling as a weapon. The slinger managed to throw a stone directly at Goliath's head. Goliath fell face first into the ground. David rushed to claim Goliath's sword and used it to decapitate him.
The Philistines were reportedly terrified into retreating towards Gath and Ekron. David claims the head and armor of Goliath for his own. Saul was officially introduced to David, son of Jesse from Bethlehem and the story concludes there. Goliath then appears again (!) in chapter 21 of the Second Book of Samuel. There Goliath is briefly mentioned killed by Elhanan, son of Jair. The text is considered older than the one in the First Book but its unclear what the context would be.
The contradiction has led to several interpretations over the years. Already the First Book of of Chronicles (4th century BC) attempts to resolve the contradiction by claiming Elhanan killed a brother of Goliath. Later scholars have alternatively suggested that:
*two different Philistines either had the same name or were given the same name by tradition. For example if David faced an unnamed opponent, a later author could have chosen a known Philistine name for the guy.
*A folk story concerning Elhanan and Goliath was turned into one about David and Goliath. Or both tales may be variants of the same folk story.
*Elhanan may be an alias of David. This theory has been proposed by proponents of Biblical innerancy but if so its an alias only mentioned once. Thus it would confuse readers unfamiliar with the alias.
The height of Goliath has differed much over various transformations of the text. The Septuagint version of the Bible, the Dead Sea Scrolls and the historian Josephus (all available in the 1st century AD) agree that Goliath's height was "four cubits and a span". That would be about 2 meters or 6 feet, seven inches tall. The Masoretic text at least since the 10th century AD and all translation based on it change the height to "six cubits and a span". That is 2 meters, 90 centimeters or nine feet, 6 inches tall.
Some details of the text such as David introduced to Saul after the battle with Goliath, contradict previous chapters of the book. David was already depicted serving in David's court in previous chapters. Some of the verses introducing the contradictory details are notably absent in several extant versions of the Septuagint text. Making it likely they were later additions or corrupted text.
The city of Gath served as a major Philistine center until the 9th century BC when it was pillaged. Later efforts to resettle it never restored it to its previous glory. Its unclear who destroyed the city but it has been theorized it could be a result of Damascus' expansionist policies at the time. In the story of David it appears again twice. When exiled by Saul, David offers his services to Achish, King of Gath and serves him at least to the death of Saul. In the civil war between David and his son Absalom, Itai of Gath leads 600 Philistines in support of the former. Pointing to David's relations with Gath remaining friendly well into his reign. A curious legacy for Goliath.
The Babylonian Talmud (5th century AD) makes Goliath a relative of David. According to the lineage given he was a son of of Orpah of Moab, the sister-in-law of Ruth of Moab. Ruth being identified elsewhere as mother to Obed, grandmother of Jesse and great-grandmother to David. The "Ruth Rabbah" (written between the 7th and the 9th century AD) makes the relation closer by identifying Ruth and Orphah as sisters by both blood and marriage. Which would make Goliath a first cousin, twice removed of David.