Never been there for bike week, have many friends who have. I think its safe to say that the crowd starts a few days before the official rally kick off, and can run a few days after.
Have a neighbor who went to SD unaware of Sturgis with his wife and family a few years ago. Think he hit town in the middle of the whole thing. I can't remember now where they ended up staying for the night, but their plans were to stay near Sturgis. They eventually found a room a 150 miles away from Sturgis.