I think it was only a couple months or so at my absolute max weight (183), but I had been steadily gaining for at least a couple years to go from 145 to finally get there.
I was aware I was gaining, but it was so gradual I wasn't alarmed at first. Friends/enablers
kept telling me "oh you're tall, so the weight doesn't show at all".
The tipping points were the doctor pointing out my weight changes. Then going through a couple clothing size changes. I had to ask myself did I really want to spend money investing in a whole new set of clothes to compensate for my unhealthy new shape. Obviously, no!