Seven years and six months. "The time that David was king in Hebron over the house of Judah was seven years and six months" (2 Samuel 2:11). In those years Abner made Saul's son Ishbaal king over the northern tribes, and "there was a long war between the house of Saul and the house of David" (3:1). Only after Ishbaal's death did all the tribes come to Hebron and anoint David king over Israel (5:1-3).
The forty-year reign of 2 Samuel 5:4 splits into those seven and a half years at Hebron and thirty-three in Jerusalem (5:5). The note in the New Oxford Annotated Bible reads the long war as a sign that Saul's family had more support than 1 Samuel's unflattering picture of him suggests. Forty years is also a round number, the length of a generation.
Learn the Bible.
Not just the stories, but the history, authorship, and scholarship behind it.