Generally, if 'hier', 'da' and 'dort' are used to designate place of varying distance, then
- 'hier' refers to closest proximity
- 'da' refers to a larger distance from the speaker
- 'dort' indicates largest distance.
Imagine you talk to someone within an interesting park full of interesting features.
'Hier stand die alte Mauer der Stadt, da war der Wachturm, und dort (drüben) war das alte Rathaus'
However, nobody takes it as strict. In particular, 'da' and 'dort' are often used interchangably. These rules do not cover idiomatic usage (e.g. phrases like 'hier und da'), or you may completely dismiss the distance rules if you refer to a couple of locations and don't want to repeat the same word over and over again.
(When revering to a map:) 'Hier ist die Autobahn A3, dort sind wir, und da war ist die Raststätte wo wir gestern gegessen haben'.
For more information about the (lack of) difference between 'da' and 'dort' see this article published from the Philologisch-Historische Fakultät Universität Augsburg.