It varies. For some people whose microbiome has been depleted by antibiotics a short course of probiotics is all that is needed. Some people need to continually provide the microbiome with probiotics and some need to focus on a prebiotic as well.
My son-in-law has been taking good quality high strength probiotics for a year and a recent stool test showed a reduction in bad bacteria but still an incredibly low count of friendly bacteria.
When it comes to establishing them, I gather that the most important thing that we can control is giving them the right food, the right kinds of fibre to live on.
(The thing we cannot control is how the bacteria already in the gut will react to them. I recently glanced at a paper talking about how listeria could stop some probiotic bacteria or other from establishing itself.)