Jabez Wilson explains all the rules regarding his position with the League of Red-Headed Men at the beginning of the story, and Holmes explains all of his deductions to Watson at the end of the story, after John Clay has been captured and taken off to jail.
John Clay's confederate, Duncan Ross, has told Wilson:
"Well, you have to be in the office, or at least in the building, the whole time. If you leave, you forfeit your whole position forever. The will is very clear upon that point. You don't comply with the conditions if you budge from the office during that time."
The hours are from ten to two.
Towards the end of the interview, Holmes asks, "What is he like, this Vincent Spaulding?"
"Small, stout-built, very quick in his ways, no hair on his face, though he's not short of thirty. Has a white splash of acid upon his forehead."
And Holmes asks:
"Have you ever observed that his ears are pierced for earrings?"
"Yes, sir. He told me that a gypsy had done it for him when he was a lad."
Obviously Holmes believes he knows the man. If so, Holmes probably knows him to be a criminal, because Holmes keeps extensive records on all the crimes and criminals in England. Near the end of the story Holmes tells Watson:
"You see, Watson, "it was perfectly obvious from the first that the only possible object of this rather fantastic business...must be to get this not over-bright pawnbroker out of the way for a number of hours every day."
It would appear that at first Spaulding was working alone. He would go down into the cellar on the pretext of working on his hobby of photography. But he must have found it awkward to have his employer present when he did this. After all, he was getting paid to mind the shop and not be spending time down in the cellar. So he devised a way of getting rid of Wilson for at least four hours a day with his invention of the Red-Headed League. He probably had closer to five hours for working on his tunnel, because it would take Wilson a little while to get to the League offices and then to get back to the shop after two o'clock.
No doubt the man who called himself Vincent Spaulding could bring in one or two helpers and speed up the tunneling work greatly once he had his boss out of the way. Time was of the essence. The gold would not remain stored in the bank permanently. With Wilson gone for a set number of hours each day, Spaulding and his partners could lock the front door and put up a Closed sign, so that they could give their undivided attention to the tunneling. Besides the awkwardness of having Wilson present, the tunnel was growing longer and there must have been a problem getting rid of the accumulated dirt. The burglars might also have had to bring in timbers to shore up the walls and ceiling of their tunnel. And there was always the danger of Wilson's discovering what was being done down in his basement.
It appears that Holmes suspected a criminal enterprise from the beginning and that he even thought he knew the true identity of Vincent Spaulding. He shows this when he asks Wilson if Spaulding has his ears pierced for earrings. The rest of Spaulding's description he obtains from Wilson himself.