"Gdzie" means "where." But it only means "where" in relation to where something is at a given time, without any consideration of where it has been or where it is going. There are different words for "where" depending on where the action is moving.
"Dokąd" means "to where?" And "skąd" means "from where?" You would use these if the "where" is moving. Some of the uses are much too nuanced for me to discuss here, but I would suggest a good grammar book if you are interested in checking out this topic further. And I'm told that many Poles mix them up in actual usage in colloquial or vernacular speech, so you may not get a sense of how to use them correctly from listening to ordinary conversation.
But there are other words that denote position (in space or time) in connection with some motion:
stąd - from here (also "hence")
dotąd - to here (also "this/that far, so far, until now, that high")
stamtąd - from there
odtąd - since then
odkąd - since when, ever since
dokądś - to somewhere
donikąd - to nowhere
znikąd - from nowhere
skądinąd - from somewhere else
stąd dotąd - from here (one place) to here (another place)
precz stąd! - Get out of here!
nie pochodzę stąd - I'm not from here/I'm a stranger.
daleko stąd - far from here
jak dotąd - as of yet
ależ skąd - not at all, nothing of the sort