In some cases inserting a comma after a prepositional phrase helps to clarify the meaning of the sentence. In others it's a grammatical necessity. Fortunately, the rules regarding commas after introductory prepositional phrases are fairly straightforward. They deal with the number of words or phrases rather than the relationship between the words. Thus, determining whether a comma is needed is often, though not always, as simple as counting the number of words you have written.
Four or Fewer
If a prepositional phrases contains four or fewer words, usually no comma is needed as in the following sentence: On the table a bottle of champagne rested, conserving its energy for the upcoming festivities. Prepositional phrases of five or more words require a comma: Beneath the dusty redwood table, the cat crouched with murderous anticipation. The punctuation marks serve to indicate how the sentence is to be read aloud. As such, the first sentence would have no pause, whereas the second sentence would be read with a slight pause after table. While the word count may appear arbitrary, it reflects an organic speech pattern.
Five or More
As noted above, prepositional phrases containing five or more words should be followed by a comma: In this time of economic depression, worsening drought and dwindling mineral resources, children were particularly vulnerable. Some prepositional phrases may require commas within the phrase: On that tall, cold, green mountain, the birds are loudest at dusk. The comma does not impact the punctuation a longer prepositional phrase would require, so punctuate series, parenthetical elements and adjectives as you normally would.
Two or More Prepositional Phrases
If the prepositional phrases themselves are in series, you should separate them with a comma: By land, by sea, by air, we'll get that package to you within a week. The prepositional phrases stand alone, so they should be separated as a series. In the sentence "On the hill with the fairy grass, we stopped to eat lunch," the prepositional phrase "with the fairy grass" modifies "on the hill." Because neither phrase can stand alone, the no comma is needed to separate the phrases.
At times, a comma can help to clarify the meaning of a sentence. Writers may use clarifying commas even if the prepositional phrase contains four or fewer words as in the following examples: "Before the snow flurry birds sought shelter," and "Before the snow flurry, birds sought shelter." Without the clarifying comma, the reader might read "snow flurry birds" as a single concept and the sentence as a fragment. Prepositional phrases tend to merge with nouns, but be sure to read each sentence aloud. If you pause to separate the phrase from the main clause, insert a clarifying comma.