At the end of a company's fiscal year, you should close all of the temporary accounts. Temporary accounts accumulate balances for a single fiscal year and are then emptied. Conversely, permanent accounts accumulate balances on an ongoing basis through many fiscal years.
The most common types of temporary accounts are for revenue, expenses, gains, and losses - essentially any account that appears in the income statement. In addition, the income summary account, which is an account used to summarize temporary account balances before shifting the net balance elsewhere, is also a temporary account. Permanent accounts are those that appear on the balance sheet, such as asset, liability, and equity accounts.
At the end of the fiscal year, you use closing entries to shift the entire balance in every temporary account into retained earnings, which is a permanent account. The net amount of the balances shifted constitutes the gain or loss that the company earned during the period.
Once the year-end processing has been completed, all of the temporary accounts have been emptied and therefore "closed" for the current fiscal year. You then set a flag in the accounting software to close down the old fiscal year, which means that no one can enter transactions during that time period. You also set another flag to open the next fiscal year, at which point you open the same temporary accounts, now with zero balances, and use them to begin accumulating transactional information for the next fiscal year.
Thus, the only accounts closed at year end are temporary accounts. Permanent accounts remain open at all times.