An extension is necessary to avoid a penalty for late filing if you expect to have an amount due on your Federal Return and cannot meet the April filing deadline. The extension does not provide you with more time to pay the amount owed- only more time (6 months) to complete your return and file.
If you are due a refund you do not need to file an extension; you have three years from the filing deadline to file the return and claim your refund. Returns filed after the filing deadline (with extension) cannot be e-filed, they must be printed and mailed. Taxpayers have three years to file a return after the filing deadline.
After this three-year period taxpayers will not be able to claim any over-payments or credits. However, the IRS can collect any unpaid tax for any tax year. There is no limitation of time given to the IRS to asses unpaid tax obligations.