Researchers at Vanderbilt University tested that assumption on people born in or before 1915, who had lived through the 1918 influenza pandemic as infants or young children, drawing blood from them nearly ninety years later.
All 32 survivors tested still showed an immune reaction to the 1918 virus's surface protein. In seven of eight blood samples tested, memory B cells still made antibodies against it, and five antibodies cloned from three donors were potent virus-neutralizers that protected mice from a lethal dose of the reconstructed 1918 virus.
The antibodies carried an unusually high number of mutations, a sign of decades of fine-tuning by the immune system rather than a static memory. The study involved a small group of very elderly volunteers and one specific virus, so it answered how long human immune memory to a single pathogen can last, not how durable immunity is in general.

Read the original study
Ninety years, and the memory still worked.
Source
- Yu, X., Tsibane, T., McGraw, P. A., House, F. S., Keefer, C. J., Hicar, M. D., Tumpey, T. M., Pappas, C., Perrone, L. A., Martinez, O., Stevens, J., Wilson, I. A., Aguilar, P. V., Altschuler, E. L., Basler, C. F., & Crowe, J. E. (2008). Neutralizing antibodies derived from the B cells of 1918 influenza pandemic survivors. Nature, 455(7212), 532–6. https://doi.org/10.1038/nature07231