I was around 23 or so, I don't think there is a good and hard fast rule, but indulge me a quick story that I think could be of benefit to some:
I was getting close to 20 and hadn't soloed and for good reason: I was not ready-period. I always felt behind the plane, I was terriblly uncomfortable with landing-I was doing a poor job I felt. I wondered in my head, "I've heard the average is around 10-12, and I don't even feel close I wonder if I'm just not 'cut out' to be a pilot" Which bothered me deeply as it had been a life long dream. I read an article in Pilot Training about "Instructor/Student" match up, and one day when my instructor was out of town I really just wanted to fly, so I called the neighboring airport to see if they had a plane and instructor available, they did. I drove over and Jack and I jumped into their 150 there was a slight crosswind which made me terribley nervous, and when I say slight-I mean slight. We taxied out and I had warned Jack that my proficiency was low. I took off with no assistance and he said, "Your crosswind handling was fantastic" I explained to him I had a tough time with slipping it to be straight at landing, so we flew in a slip for miles over a road. Went back and pegged the landing. I asked Jack if I could switch to him, he said he was real tied up to take on a full student but Fred could take me, and if I didn't like Fred just give him a few weeks and he would be open enough. I went with Fred and had just as good of a time as I did with Jack. I notified my first instructor I would be changing and thanked him for all his time to that point. I flew with Fred about 2 hours and he hopped out to "go to the bathroom" and said, "I'm grabbing my handheld, i'll drive out on taxi way, now go do 3 take offs and landings, I usually don't solo people with an 8-10mph crosswind but you got it". I went and did it!
The moral of the story is be conscious of instructor/student match up. This does not mean that if you haven't pulled it off in 12.1hr its time for a switch- but I just knew something wasn't right as I approached 20 with little progress the last 10 or so... I remain to this day convinced it was an instructor/student mis-match, especially considering how smooth it went those next few hours. Does that mean my first instructor was a bad CFI? By no means! I know of multiple people whom he's helped get their ticket- it means my learning style and his teaching style didn't gel well together. So take as long as you need to be safe and proficient. But also be aware if you are "stalled" in progress to maybe try someone else for an hour or three to see if its different, it sure made all the difference in the world for me... I had learned a ton in those first 20, but hadn't been able to apply it, Jack and Fred helped me apply what the first guy had taught me and it all just "clicked". So not to be redundant, but I'm not advocating hopping all around because of a lesson that didn't go awesome or things are taking a bit longer than hoped, but be couscous of your progress, if you are making progress hold the course. If you feel stalled out in progress for a bit try a different CFI and see if a different style of teaching helps... And again if you need to change up that it doesn't mean the instructor was poor, it may just mean learning and teaching styles were not a match. My first instructor and I had no hard feelings over this and I met up with him several years after getting my ticket at an airport an hour from home by chance and he was so happy to see me out flying.