The short answer
Your thirties, by a wide margin. Late thirties most of all.
This is not because people get less likable at thirty five. It is because the thirties are when every structure that used to produce friendships for free expires at roughly the same time, and nothing automatically replaces them.
Why the thirties and not some other decade
Run through what happens in a normal life between about thirty and forty.
The friends you kept from school finish scattering. People move for jobs and partners, and the ones who stay drift into different schedules. Your twenties had a long tail of shared availability, a group of people who could all get a drink on a Tuesday. That tail runs out.
Work stops being social. In your twenties the first job was full of people your own age doing the same thing for the same money, which is functionally a second dormitory. By your thirties you are more senior, your colleagues are spread across ages and life stages, and the ones you manage cannot really be your friends.
Children arrive, for you or for everyone around you. This is the largest single factor and it cuts both ways. If you have them, your discretionary evenings go to zero for several years. If you do not, the people you would have spent those evenings with disappear anyway, and you are left standing in a decade that emptied out without warning.
And the default drops to zero. This is the part people miss. In your twenties you could make no effort whatsoever and still end up in rooms with people. From your thirties on, the number of friendships that happen without deliberate effort is approximately none. The skill required did not increase. The amount of free scaffolding fell off a cliff.
Why forties and fifties are usually easier than they look
People assume it keeps getting worse forever. It generally does not.
By the forties, several things stabilize. If you had children they become less consuming, and they also hand you a ready-made set of containers: the school bus stop, the sideline, the playground, the PTA meeting, other parents you see every single week without arranging anything. Careers settle. Most importantly, expectations reset. People stop assuming friendship should be effortless and start treating it as something you schedule, which is precisely the attitude that makes it work.
Retirement age brings a second cliff, and it is a real one. Work was the last remaining structure, and when it goes it takes the daily contact with it. But that is a different problem with a different fix, and it is well served by becoming a regular somewhere close to home.
What people get wrong about this
The common reading is that friendship gets harder because you get worse at it. Less open, more set in your ways, more guarded, less interesting. That story is almost entirely wrong, and believing it is expensive, because it points you at fixing your personality instead of fixing your calendar.
What actually changed is the supply of repetition. Every friendship you have ever made came from seeing the same people over and over in a setting where talking was normal. School supplied it, the dorm supplied it, the first job supplied it. Your thirties are simply the decade in which all three suppliers close and nobody sends a notice.
That reframe matters because it makes the problem solvable. You cannot become twenty two again. You can absolutely put one repeating thing back in your week.
What to do if you are in it right now
Assume nothing will happen by accident, because it will not. Everything from here is on purpose.
Pick one container that repeats weekly and survives a bad mood: a rec league, a run club, a class with a fixed end date, a volunteer shift, a standing table at the same taproom. Weekly matters more than the activity. Go six times before judging it, because attendance two and three are always the worst ones and most people quit there.
Then lower what counts as success. You are not looking for a best friend this year. You are looking for eight or nine people who know your name and expect to see you, which is the raw material every friendship is made of and the thing your twenties handed you without asking.
And reach out to the friends who scattered rather than writing them off. Dormant friendships are far cheaper to restart than new ones are to build, and the thirties are full of people who assume everyone else is busy and are waiting to be contacted first.