At leastLower bound: 2-3 days, possibly (probably more).
Summing up, we have a sum of at most half a day in the scenes we see in detail, a day and a half crawling from Room 12 to the teleport chamber, and at least several hours, maybe much more just wandering the castle, mapping it out, getting his bearings, eating, etc. Summing to a minimum of 2-3 days, but potentially a lot more.
Upper bound: 6 years(probably much less).-As in the nice answer by Mike C. Ford, let's look at screenshots of the underwater skulls in order to get an estimate of how many iterations the Doctor must have been through by the time 7000 years have passed. Firstly:
There are over 40 skulls in this shot. But we can do better!
In this widepan shot from a few seconds later in the episode (around 14:30 on the iPlayer version available on the BBC website), we can see hundreds and hundreds of skulls. Within the red rectangle I've drawn, I estimate there are at least 20 skulls. This rectangle is around 1/60 of the screen, and we don't need to take account of perspective (foreground skulls being larger than background skulls) since the rectangle is roughly in the middle of the screen, front-to-back wise. That gives us an estimate of 1200 skulls (and probably many more).
Dividing 7000 by 1200 gives around 5.8, so let's say 6 years as an absolute maximum for the length of cycle one could fit around 1200 times into around 7000 years.