They are quite strict on this. If you get a permit for Saturday, say, you must start up the trail between 12:01 AM and 11:59 PM on Saturday. (Actually midnight to midnight.) It doesn't matter how many nights you want to stay out, except there is a maximum stay per trip of nominally 2 weeks.
They will ask you how many nights you are going to be out, and where your planned campsites are, and that info will appear on your permit. But your answers do not affect whether you will get your permit or not (for Saturday); it only helps them in assessing backcountry use. And there is no problem if you come out early or late - even by many days.
If your permit is for Saturday, you must pick it up by 11:00 AM on that day or it will be released to others. I believe, though, you can call them and they will hold it for you. Hold it, I believe, until closing time. Whether they will put it in the outside box for you to pick up after they close, I don't know. Most cases of people wanting to pick up permits when the ranger station is closed involve early pickups, not late ones. They may feel that if they put the permit outside for you to ostensibly pick up in time to start hiking by 11:59 PM, you may instead start in on Sunday - which would be the next day, hence "illegal."
If your permit is for Saturday, you can actually pick it up on Friday after 10:00 AM. But you cannot start hiking until that night at midnight.
There are some caveats, such as the Trail Crest quotas and Muir Trail hikers, but they only come into play infrequently.