Definition: At the last possible moment.
Origin: The phrase is a biblical allusion to the parable of the laborers appearing in Matthew 20:1-16. Jesus describes laborers who were hired to work in the vineyard at the eleventh hour (ie, late in the day) were paid the same as the laborers who began work at the beginning of the day and had “borne the burden and head of the day.”
The armistice signed by the allies and Germany that ended World War I came into effect literally at the eleventh hour: on the eleventh hour (11:00 am), of the eleventh day, of the eleventh month (November) of 1918. The day was commemorated as Armistice Day, and after WWII, the name was changed to Veterans Day in the United States.
For further reading: From Hue and Cry to Humble Pie: Curious, Bizarre, and Incomprehensible Expressions Explained by Judy Parkinson, B&N Books (2000).