Source? There is no 48 hour limit. Did you read the article? It's about US troop pokemon staying in gyms long after the personnel have left.
Googling gave me this answer for how they stay in gyms:
"Forever. Someone has to defeat it in battle to knock its motivation down to 0. Otherwise, it will never hit 0 through normal decay."
I guess they call it "motivation decay". It's a mechanic where you have to feed your pokemon food to keep it motivated. You can feed it remotely, though. They can be fed up to 10 times with normal food, or an unlimited number of times with golden raspberries.
EDIT: I was wrong about getting kicked when the boss came. So if you kept feeding your pokemon, you could keep it there indefinitely. My bad.
As a person who plays daily, my understanding is you don't have to feed it any berries (and it will stay there indefinitely until a rival team member knocks your pokemon out by battling).
Googling gave me this answer for how they stay in gyms: "Forever. Someone has to defeat it in battle to knock its motivation down to 0. Otherwise, it will never hit 0 through normal decay."
https://www.reddit.com/r/pokemongo/comments/fjl4xz/how_long_...