When do I know that I need to sharpen my crampons? In documentaries, I have seen people filing their crampons.
I usually sharp my crampons when I am expecting icy conditions, that means glare ice. Especially when you go steep and need front point technique, you need to rely on those points - all your bodys weight. If your front spikes are too coarse, you need much more energy to bring them secure and stable into the ice. Besides that, the ice will splinter and break which is possibly dangerous (especially on thin ice).
This is in general the same for your other ice climbing gear, namely ice axes and ice screws.
If you are just "glacier hiking" and maybe (indeed this is very likely on most alpine tours) also having rock contact with your crampons, I won't sharp them at all. The more frequently you sharp the gear, the faster you need to replace the front points/spikes.
According to Will Gadd, you should sharpen your crampons and ice tools after every use.
If you spend just a minute or two after each trip–sometimes you won't even need a minute, just give them a look over and a couple passes with the file to take off a couple burrs–then you're never going to have to worry about dull points. Regular maintenance also ensures that your gear wears evenly, if you wait too long between sharpening, then you're going to be dealing with really dull points and spend a lot of time trying to fix them back up.
It's better to give them a couple strokes with a file after each use when you're putting them away, rather than spend an hour trying to restore them. You'll spend less time sharpening in the long run.