No, that money is yours to take with you when you leave and use for qualified medical expenses. However, your annual maximum amount allowed by the IRS will be prorated based on the amount of time you were employed at the state in that year. If your contributions exceed that prorated amount, you will be responsible for paying income tax on the additional amount.
For example, if you leave your job on June 30, the individual amount you will be allowed to contribute for that year will be prorated to 6 months or divided in half. Instead of $3,600 it will be $1,800. Any contributions (both yours and your employers) above that amount that year will be subject to tax. For additional details, please see your tax advisor.