WHAT A GREAT QUESTION!!
Probably everyone here will have all different ideas.
I feel, it is better to risk click/treat TOO long,
than to fade treats too soon. Removing the rewards TOO soon, can confuse some dogs and slow the learning down,
but no harm at all in rewarding a well known trick. I also fade the treats out gradually, inserting praise only, and make food rewards random,
slowly fading them out,
rather than abruptly removing them entirely all at once. I keep my treats super tiny so i don't much worry about having a fat or full dog,
How do i know when my dog does know the trick?
wow, i am laffing, cuz i am not sure i can put it into words,

but someone else probably can. I guess when i can give cue,
or hand signal,
and use no lure at all, (if it was a lured trick)
or see no delay from dog nor signs of confusion from my dog,
on a consistent basis.
but i still continue, for many days, to reward tricks Buddy has
just learned, cuz for *my* dog, he might do great on his new trick on Monday,
but if i stop rewarding it, or practicing it,
and don't do that trick again for a week,
well, my dog might backslide or forget or something.
i give my dog daily lessons, even if it's only 5 or 10 minutes, especially when he is just learning a new trick.