The ranking queue manages moving beatmaps from Qualified to Ranked. Every day, 16 beatmaps from each game mode are able to move from Qualified to Ranked, as long as they have been in Qualified for at least 7 days. The time of day that beatmaps get ranked is random.
When a beatmap is disqualified, its time spent in Qualified so far is saved. If it gets re-qualified, it will enter the queue as if it had been in the queue for that duration already. This ability to "skip" time spent in the queue caps at 6 days to ensure that beatmaps always stay in Qualified for at least a full day.