There are circumstances where you can omit for, but I don't know of any summary of the situations when it's acceptable. There are few situations where it's not acceptable to use for. One example is when you use be with the time interval as the object:
I will be five minutes - correct
I will be for five minutes - wrong
One suggestion for when it can be omitted is given in this answer, which suggests that it's OK to omit for when the time phrase includes more than, less than, etc.
My impression is that the omission of for is a stylistic trick that adds emphasis to what you are saying, for example in this sentence it emphasizes that five minutes is a very short time:
I was only gone five minutes and they stole my car!
In the same way, emphasis would certainly be relevant to your first example:
He hadn’t been dead five minutes before those vultures from the media were after his widow.
One could argue that the the widow in the second example wants to emphasize what a long time it seems to her:
"You're a widow?"—"Yes. My husband's been dead a year now."
Certainly, with for included, this would seem a more neutral statement.