Brain fog is considered a Long COVID symptom if it’s present three months after the person had COVID and has persisted for more than two months, Dr. McAlpine says. It usually goes away completely between six and nine months after the infection, although in some people it lasts as long as 18 months or more, Dr. McAlpine says.
https://www.yalemedicine.org/news/how-to-manage-long-covid-brain-fog
There's actual journal articles out there but this is a quick estimate of the timescale.