There is no indication in the passage as to the time that had passed between the previous Philistine invasion (1 Samuel 13:1 – 14:52) and the one concerned here. Presumably a number of years had passed. The campaign certainly took place after Saul had fought and defeated the Amalekites (1 Samuel 15:1–35) as well as the other enemies mentioned in 1 Samuel 14:47–48.
1 Now the Philistines gathered their armies for battle. And they were gathered at Socoh, which belongs to Judah, and encamped between Socoh and Azekah, in Ephes-dammim.