How long is it safe to drink coffee after brewed? How many hours/days would you recommend to drink coffee (after brewed) and consider it safe? (For example if you don't want to waste it). What is the difference if it is refrigerated or not?

The question is not about flavor since (I think) it is probably ruined after at most a couple of hours.
If it's refrigerated, it'll last for at least a week, as long as you didn't pre-dairy it. 

Unrefrigerated, I wouldn't trust it for more than a day. Coffee is a crappy growth medium and it should start out the next best thing to sterile, but, even covered, its going to start to get moldy.

Obviously if you add dairy, then you're dealing with that dairy shelf-life, and that isn't very long at all.