The framing story of 1001 nights allows the number of nights to be nowhere close to the number of stories.
Sometimes, one story would last for 3 or more nights due to the introduction of so called Red Herrings. Shaharazad would start a story one night, then in that story a character would tell a story to a different character as a way of teaching him some lesson, and that story within a story would end in the middle, on a cliffhanger.
Then she would continue the story within a story and end it as a lesson to a character, then continue the original story, which would end on a cliffhanger. Once she finished that story she would return to a minor character of that or a previous story within a story and start a new story.
The number of stories and the number of nights doesn't even have to be close.
There once was a prince named A who had a mischievous nature. He would often get bored and his servant named C would try to find a way to keep him amused. They had many funny adventures together. For example, one time (long story ending on a cliffhanger. Next night that story is over)... The father of prince A, a sultan named B, often despaired about A's fate. B worried that A wouldn't be his worthy successor and that the kingdom would come to ruin once A became sultan. He had reason to worry because of the way B became sultan. Many years ago... (long story of how B became sultan, the night ending on a cliffhanger in the middle of that story)... So, to prove that his son A would be a good ruler, Sultan B sent him on a quest (long story of a quest). During that quest A and C had to take a sleep in an inn. (Long description and story of how the innkeeper got his fortune and why he made an inn at that exact place).
To amuse his prince A and the other patrons, servant C told them a funny story (servant's story) then they continued on the quest... And so on and so forth.
And that's just one story, stretched on 20 nights, with dozen of smaller stories contained in it!