contemporary etching of troop disposition at the beginning of the Battle of Breitenfeld (1631) — image: Wikimedia
The phrase to save the day means to avert failure or disaster.
It originated in the context of military engagements: day denotes a day of contest on the battlefield and the literal sense of the phrase is to avert defeat in battle.
For example, in A chronicle of the late intestine war in the three kingdoms of England, Scotland and Ireland with the intervening affairs of treaties and other occurrences relating thereunto : as also the several usurpations, forreign wars, differences and interests depending upon it, to the happy restitution of our sacred soveraign, K. Charles II (2nd edition – London, 1676), the English historian James Heath (circa 1629-1664) described how, during the siege of Dunkirk in 1658, the English and French forces routed the Spanish army:
This Fight was managed chiefly on the Spanish side, by the noble Duke of York, (accompanied with his Brother the Duke of Gloucester) the Military Renown of whose actions very early raised it self in the French service, (as before) and was brighter far, and more eminent in the glories of this day, which suffering an envious Eclipse, drew greater admiration upon him: he did not only maintain the Fight till the irresistible daring gallantry of the Honour-seeking Red-coats made the Spaniard abandon his Punctilio’s, and mend his retreating pace, but sustained the impression upon the flight, and at least saved the day.
The word day in this sense frequently appeared as a direct object of verbs such as to carry, to get, to lose, to win. In A hundreth good pointes of husbandrie (London, 1557), the English poet and writer on agriculture Thomas Tusser (circa 1524-1580) advised:
With tossing and raking, and setting on cox¹:
the grasse that was grene, is now hay for an ox.
That done, leaue the tieth², lode thy cart and awaye:
the battell is fought, thou hast gotten the daye.
¹ cox: a heap of hay
² tieth: tithe?