Ryanair and LOT fly from Krakow to Gdańsk 3 times a day. Alternatively, Polish Railways (PKP) operates a train from Krakow to Gdańsk every 2 hours. Tickets cost $18 - $27 and the journey takes 5 h 30 min.
From Kraków Główny train to Krakow airport, fly to Gdansk airport, train to Gdansk Wrzeszcz, then tram to Gdańsk. 3 h 1 min $47. From Krakow Glowny train to Gdansk Glowny. 5 h 30 min $23. From Krakow bus to Gdańsk. 10 h 5 min $42. From Krakow drive to Gdańsk. 5 h 38 min $76.