Points for points competitions only (can be finishes, intermediate sprints, KoM and all be separate or combined competitions, specific race regs apply, usually it's intermediate sprints and finishes for points jersey, KoM points for, er, KoM). None of this affects time bonus, these are separate competitions within the race. Again these are usually at intermediate sprints and finishes, even at KoM depending on the race regs for the particular race.
All time bonuses are taken off GC total time, never stage time.
And all of this only happens in stage races where time is concerned. On a single day race it's been known to have a climbers competition but that's about it, for example in quite a few Belgian races there's a "bergpriejs" for the rider getting most points on classified bergs, just to make a hard race with nasty (often pave) climbs even harder! One thing, no-one ever won that in Paris-Roubaix......