Both package types mine until their balance is spent. A Fixed package adjusts its speed so that this happens around the end date. A Flexible package keeps its speed, so its duration is an estimate.

What happens when the price of hashrate rises while a package runs. When it falls, the effect is reversed.
Your virtual miners run continuously for the selected duration. The price of hashrate is corrected every minute, and the speed is recalculated each time so that your balance is spent at about the end date. The duration cannot be extended.
Your virtual miners run at the speed you selected. The duration shown at purchase is estimated from the current price of hashrate: when the price rises, the package ends earlier, and when it falls, later. You can refill the package at any time to keep it running longer.
A package ends when its balance is spent. For a Fixed package this is around the end date, for a Flexible package it depends on the price of hashrate during the package. Earnings not yet paid out are paid to your wallet right away, without waiting for the next 4-hour payout. To stop a package earlier, see Can I refill or cancel my package?