In Latin, the accusative case is used for describing how long an action took.
For example: 'poeta multos annos errabat' (The poet wandered for many years)
The ablative case can describe the point in time at which the action occurred.
For example: 'prima luce milites hostes oppugnaverunt' (The soldiers attacked the enemy at dawn)
The ablative case can also describe the period of time within which the action occurred.
For example: 'pueri duobus horis laborem non confecerant' (The boys had not finished their work within two hours)