How long can a person stay on methadone?

A very long time. Methadone has several uses. It is a dangerous medication if not used correctly & under strict guidance of a physician who is trained in it's us. It can be used for chronic pain & for drug rehabilitation. If all the correct precautions are used & one is followed closely & is careful with co-administration of other medications, it can be used for many years without harm. See pcp/pain mgmt doc.
No limit. A cancer patient might be in it for the duration. A semi-acute injury might use it for weeks with a slow taper. An addict might use it for a month long detox with taper or for long-term maintenance depending on drug cravings. For non-cancer chronic pain a stable low dose is generally safe. I do not escalate and chase tolerance with Methadone as higher doses can cause dangerous heart rhythms.