Generally speaking, any time a new reference is created, you'd increment, and every time one is destroyed/discarded, you'd decrement.
Function arguments require a copy, so that's an increment. A function return value requires a copy, so that's an increment. Of course, in many cases, there'll be corresponding, simultaneous discards as well, so you could potentially optimise by not modifying the count.
Of course, in C, this can get very complicated and error-prone very quickly, because you have to do everything manually. A broken/unreliable reference-count mechanism is arguably worse than none at all.