I took 18 months to do my PPL and tested at 46 hours. One of the surprise advantages to spreading it out was that I realised very quickly which aspects I remembered and which bits I forgot. By the time I was approaching "test ready" I was able to still have 2 to 3 weeks between lessons and was quite good at knowing what I was going to forget and therefore address it beforehand. I think the largest gap I had between lessons during PPL training was about 4 months (rubbish weather, less daylight and instructor availability during the winter months).
I then had almost a year between finishing my PPL and going hour building and even with that amount of gap between flying I knew which areas I was likely to be rusty at as I had already been exposed to the situation of not flying for a while.
Swings and roundabouts of course, do whatever works best for you financially.