The monitor being ill, we'd better put the meeting off.
The river having risen in the night the crossing was impossible.
In the above two sentences, one uses the comma and one does not. So, when do you use the comma? Are there any rules?
It's generally a matter of style. The only hard and fast rule with commas is that they should be used to separate items in a sentence.
I would put a comma in the second sentence, after 'night'. The thing to remember is that commas make things easier to read. They are a courtesy to the reader.
Read that second sentence as it is, then read it again, but this time, pause for the length of time it takes to say 'comma' in your head after 'night'. Sounds better, doesn't it?
The others are correct that in those examples the comma makes the meaning clearer.
I would add that using the gerund clauses as you have sounds somewhat stilted. Perhaps you could try more straightforward ways to express the same ideas:
There are obviously other ways to construct the sentences; these are just a couple to give you the idea.
It is certainly correct to write each of the two sentences with a comma. Here the comma serves as a bracketing comma which introduces the monitor being ill and the river having risen in the night to add to the meaning of the complete sentences
The bracketing comma may be omitted if the meaning is clear without it, and this happens when what is added by the comma is short. In these two examples, it is not wrong to omit the comma, but it seems better to include it.
The rule that applies for your two examples is:
Use a comma after introductory phrases and clauses.
A simple sentence:
A simple sentence with an introductory phrase:
The acception to this rule is: if the introductory clause or phrase is very short, you can leave the comma out--or not, it's your choice.
Both of these are okay:
Both your examples require a comma: