How long will muscle memory and strength last if you take time off from training (say 3-6 months)?
The concept of ”Muscle Memory” or neuromuscular conditioning, is basically a form of efficiency developed through practice and repetition similar to any other physical competency.
It is sometimes treated with a kind of superstitious awe as a form of voodoo, presenting some variety of magical property that perhaps will allow the practitioner to go away on a journey to a distant land whose people have never heard of a dumbbell, not lift for years, come back and in a matter of weeks or days get back to their old hulk ways.
The answer to the question of ”how long muscle memory lasts” is that:
It lasts for a while.
How long a while depends on a variety of things including how long you have trained, your age, your physical activity level (other than weightlifting), health and nutrition status (protein intake/injury/surgery), genetics and so on. Strength is only one aspect of muscle memory, hypertrophy, lifting efficiency, power, endurance, etc. are also important components which also go comprise this concept.
A ballpark estimate of mine will be that in 3–6 months of not-training (or detraining), for the majority of people who have trained less than 5 years, very little, if any muscle memory will be in evidence when training is resumed.

Where the hell did I put all that muscle? I know that I stashed it somewhere.