Hello, I write with the experience of a hospitalero, and there are a few more of us who think in a very similar way.
As they say Bradypus and Ian &Linda you can book perfectly two days in advance.
But (big BUT)...
If you book through Booking, ATTENTION!!, the albergues that use it have a number of beds for Booking, but not all of the albergues. And it turns out that when those beds are already occupied, Booking says that everything is already full. Then the pilgrims believe that there are no more free beds in that albergue or even in the town!!, this happens very frequently. Apart from that Booking.com receives 25 or 30% of the hostel price too much, but this is something that hostels accept voluntarily and I can't comment.
It is also easy to have beds without having reserved.
I never reserve more than 50% of the albergue, better just 30%. I want to have the greatest number of free beds each day. Mainly because I want to collaborate with maintaining the spirit of the Camino, the beautiful possibility of answering "YES" when at the door someone very tired, sweating asks me if I have a free bed... There are few things as gratifying for me as giving beds in those circumstances!!! Nor are there few of us, hospitaleros, who think like this.
If you want to reserve a bed in a single room it is different, it is logical to book weeks in advance of course.
My advice is, then, that if you want to reserve a bed, do it two days in advance, even three or four if you want to be very relaxed, so you can also have the wonderful feeling of freedom that is necessary to do the Camino and stop where you want. or go to the accommodation you want, perhaps with friends from the Camino.
But all this is just my opinion and that of some other hospitaleros, mainly those of us who have a albergue for having done the Camino. The idea of having the albergue full from the day before makes me deeply sad, and I love filling it little by little throughout the day. Almost every day I have one, two or more empty beds at the end of the afternoon, it doesn't matter. Anything rather than reserving everything days in advance and having the feeling of having a business on the beach.
The Camino provides...
ADDENDUM
At the La Finca albergue, three kilometers from me, in Población de Campos, Maria Jose, the hospitalera owner, thought the same as me.
I want to take the opportunity here to remember that fantastic albergue and that fantastic person and wonderful cook. A great shame for the Camino that they have closed.