There is no timeframe in which you need to do this. You can pay out-of-pocket for an expense today and reimburse yourself 20 years later if you choose to do so. The only requirements are that you had your HSA established at the time the expense was incurred (see more below) and such expense was not reimbursed in any other way. And remember, hold onto your receipts!
* Please note that there is some gray area with regards to when an expense in “paid” vs. “incurred”. The conservative interpretation is that the expense is incurred when the accountholder’s obligation to pay arises, rather than when it is paid. That usually means date of service. The IRS has not come up with any definitive interpretation to-date (as of Jan 2019).
According to regulations under Section 1.213-1(a)(1), the IRS makes it clear that payment of medical expenses is different than incurring a medical expense. As such, we would recommend establishing your HSA as soon as possible to maintain flexibility for what expenses would be eligible for payment/reimbursement from your HSA.
Please be sure to check with your tax and/or a legal professional as nothing contained here is intended to be tax or legal advice.
Source: IRS Notice 2004-50 Q&A 39