How much time do you need (including travel time) to see Kutna Hora? I was wondering if it is possible if I leave my bag in a locker in the train station in the morning, see Kutna Hora, and then back to Prague to catch a night train to Krakow.
One day is certainly enough time for Kutna Hora. What you want absolutely to see there: cathedral of Santa Barbara, silver mines and ossuary in Sedlec (suburb of KH). More about the subject is in Rick Steves book: Prague and the Czech Republic. You don't have to go all the way back to Prague to catch your night train to Krakow. That train also stops in Kolin (if you go from Prague to KH by train you go through Kolin) which is only about 15 kilometres from Kutna Hora. By boarding the train in Kolin you will save few more hours for Kutna Hora and also little money.
I don't actually remember seeing any lockers at the Kutna Hora train station...
Even if they don't have lockers in Kutna Hora station they have a holding room (Uschovna zavazadel) where they will keep your luggage for a small fee. You can find uschovna in almost every train station in the Czech Republic.