This refers to the US Military but I am presuming that it is the same as in the UK.
When WW1 and WW2 were in progress many men were called up. Those who were "Commissioned" became officers.
However there were two types of commission, and those who had "Regular Commissions" signed up for a number of years, irrespective of when the war ended.
The others, presumably conscripts, signed up "For the 'duration'", where 'duration' meant as long as the war lasted.
If you did not have a regular commission you could expect to be demobbed shortly after the war finished, but if you held a regular commission then you had to remain in the forces until the date the regular commission ended, which could be several years.
Hope this clarifies things.