He was told he was given a year before his execution; the entire room was set with a Lilin’s version of a Time Turner. A year in that room is roughly three years outside of it. Meaning, the three days Tom believed he was with those girls is much longer than that. The girls themselves are aware of this, and are given potions that won’t have them affected by the different shifts in time, but they know that they are inside that room for the entire duration.