Kraków Public Transport Authority operates an efficient network of buses and trams that run between 5am and 11pm. Tickets are valid for various time periods, from 20 minutes (2.80zł) and 40 minutes (3.80zł) to 24/48/72 hours (15/24/36zł).
You can buy tickets from machines on trams and buses (automat biletów; coins only), from machines at major stops (coins, banknotes and credit cards) and from news kiosks. Remember to validate your ticket in stamping machines when you first board; spot checks are frequent.
A very comprehensive page on all topics related to Kraków Public Transport System:
What kinds of tickets are available?
As far as public transport in Krakow goes, there are tickets for two zones called Strefa I (City Krakow) and Strefa I +II Aglomeracja (Agglomeration).
Strefa I includes the whole city of Krakow, whereas Strefa II is the area outside of the city boundaries (numbers of the buses that go there start with 2, 3 and 9 – when you’re travelling in one of these buses and have ticket only for Strefa I, you have to make sure to get out of the bus before it will cross the border of Strefa II).
A vast majority of tourist attractions and hotels are located within Strefa I.
The most popular destinations in Strefa II among tourists are the Salt Mine in Wieliczka and the Balice Airport and if you’re planning a visit there, you will need the agglomeration ticket.