@centrox,
Since I always learn through examples, let me give you one:
John said: I'm leaving tomorrow.
Then, I would say: 'I'm leaving tomorrow,' John said.
Is that right? If so, I suppose that in situations involving direct speech, commas usually go inside quotation marks becuase they are part of the quoted material.
I asked about that beacuse some books cite examples like:
'Come here', he told me. (where the comma goes outside the quotation marks)