Simply, gerunds function as nouns and participles function as adjectives. The same goes for gerund phrases as nouns and participle phrases as adjectives.
Examine the two following sentences:
(1) Going to the store takes a long time.
(2) Going to the store, I spent 30 minutes in traffic.
First, we should recognize that going to the store is functioning as either a gerund/participle phrase in these sentences. We know this because of the use of going.
In (1), we see that going to the store is actually the subject of the sentence. It's directly followed by the verb takes. Since this phrase is the subject of the sentence, it functions as a noun, and is a gerund phrase.
In (2), going to the store is not the subject—instead, I is the subject. The phrase in question only describes I. Since the phrase describes a pronoun, it functions as an adjective. Thus, this time it is a participle phrase.
A good rule of thumb is to dissect the sentence. If the phrase works like a noun, it's a gerund phrase. If it's merely descriptive, it's a participle phrase.