It depends on the type of investment account, the method of calculating profits, and the distribution frequency.
Steps
You might have a profit due for a previous period, while the current period is calculated according to the product's terms or you may not be entitled to the full expected return.
Before closing, ask the bank for the "net amount at today's close" and the date any outstanding profits were added.
The figures, fees and limits in this answer vary by bank and change over time — confirm them with your bank or the official source before acting.