Buses leave Gdańsk's main PKS bus station at 09:50, 13:00, 16:35 and 19:15, returning at 08:43, 12:53 and 15:28. The journey time is just under two hours. Taking the earliest bus to Frombork and the latest one back gives you about four hours in town, which is just about enough to cover the main sights without having to stay the night. Please note that the schedule is due to change at the end of June so please check with the bus station.
As of November, 2008 there are two morning buses from Gdansk to Frombork, one around 9AM and the other around 10AM. They are not easy to figure out from the schedule, though, as Frombork is not the final destination, and the Gdansk PKS station is SO user friendly. Be careful on the way back to Gdansk from Frombork, as well, as the bus may or may not show up. Apparently there is some confusion about the local schedule, as buses that are listed on the sign along the road that consitutes the Frombork PKS station do not always show up. This can be no fun on a snowy November afternoon when you're looking forward to returnint to Gdansk. If the bus doesn't show up, just take any bus to Elblag that comes by and you can connect to Gdansk from there.