It has to do with relativity.
When you're having fun and are busy with something you're not thinking about the time passing and it passes by without you noticing so it seems to go by faster.
But when you're staring at a clock or not busy or out having fun you're thinking about the time passing so it seems that time seems slower.
Think about this. If you put your hand on a hot stove a minute will seem like an hour.
Time also seems to speed up the older we get since we experience time in a different way than children do.