When is the latest day I can file and get my refund back for 2021 Taxes?

I paid 2021 Taxes and probably overpaid by a lot.
I read that I get three years to actually file a return or else I lose the tax refund.
Is this three years from April filing date or from the October extension filing date?
In other words is it by April of 2024 or October 2024?