You have to complete most of the main story line first, which will lead you to many items. One of the items will get you into the window, I think it's the potions. You go inside and get to the top where the gears are and it fixes the tower.
to make the clock tower work firstly you need oil ,from helping a cattle girl by catching her lost calf. Then u will get an old saddle you will find a 'Barter and trade' place go in there and trade...
You dismount from your horse, then jump up onto the wood. Go left onto the Red metal beams and go in the open window. When you're inside watch out for the light brown wood (It colapses if you jump on...
Use ALL the oil on the very middle path of gears. There is JUST enough, so don't waste it on other gears. It doesn't matter if some of the OTHER gears fall off!