I have trouble deciding when to put a comma before so. The following are two examples about so. But one with a comma while the other not. Please explain when we should put a comma and when we should not.

She asked me to go, so I went.

The shops were closed so I couldn't buy anything.

Thanks very much.

1 2
Comments  (Page 2) 
The shops were closed so (no comma) I couldn't buy anything = The shops were closed so [that] I couldn't buy anything.

The shops were closed, so I couldn't buy anything = The shops were closed, therefore I couldn't buy anything = self-explantory

Not that serious, not that difficult. So dramatic are the intelligent ones. @_@
So preceded by a comma means and therefore; so without a comma means in order that. Both of your sentences need a comma.
Site Hint: Check out our list of pronunciation videos.
Correct me if I'm wrong, but the way to tell if a comma before so is not needed is to read the sentence in question placing the word "just" BEFORE so. If that stays true to the meaning/intent of the sentence, then a comma is not needed. Otherwise, use a comma as per previous comments concerning coordinating conjunctions.

It is important to note that the "just" should be placed only before the so. The meaning of just in such a sentence is to clarify the meaning of so as "so that" or "in order that" or "with the purpose of." Placing "just" in the clause after so would tend to utilize a different meaning of "just" and only confuse.

In short, if "so" is meant to mean "with the purpose of" then it doesn't take a comma.
Does the dependent clause rule apply if "that" is not included after so?
For example, I have a sentence where "that" could be inferred after "so," but it sounds awkward in the sentence.

Contact me if you are interested so I can coordinate the groups.

Both are independent clauses, but the second independent clause is more or less conditional on the first.

Any thoughts?

( stands on soapbox ) You man friend, sound like a lazy writer.

Students: We have free audio pronunciation exercises.