Hitchhiking is illegal in many states but when it was done quite abundantly, I remember being younger, under 10 so this was late 70s/early 80s, and my dad picked up a hitchhiker or two and they were no problem.
As a hypothesis, I would say months easily... it would really depend on how often you got rides and how far those rides took you.