You can take a direct train from Warsaw's central station to Gdańsk in just over 2 hours 30 minutes. They run regularly throughout the day.