I would imagine that most if not all crews perform minor refits/upgrades on their systems in the field.
TNG is evidence of this particular practice.
As for typical refit times ...
I can imagine that different classes have different refit schedules (because you cannot recall ships from deep space assignments for refits for example or suddenly pull your forces from border patrol duties).
So I would say, there is about 4 to 6 years interval for larger scale refits, sometimes more if the particular class doesn't require major overhaul of it's systems that cannot be done in the field.
Most of the refits are done in the field anyway, unless they encompass larger scale upgrades such as new warp/computer core, etc (things that force the ship to be out of commission for a bit).
Take Voyager in Season 7 when Janeway decided to make a major overhaul of the entire ship (which probably included retrofitting/upgrades of existing/old systems for which the crew created better specs but never got the chance to implement them).
You also have forced refits that encompass a full ship for example.
These are primarily done in times when outside threat such as the Borg ensue.
The Enterprise-D was about 3 years in service when it underwent a major system overhaul which improved it a lot.
Incidentally, the ship seemed much weaker when that was done.

Writers ... gotta love it when you can identify when they started dumbing things down.