For SRAM: Annually, or when they feel bad and or inconsistent. For reals: it's a really good idea to do annually.
For Shimano or Tektro: Officially annually, but really when they feel bad or inconsistent.
Magura: When they feel bad or inconsistant.
"Bad" is a mushier feel at the lever mostly. It can also be instructive to invert the bike and see how much the brakes die when used in this position: it's indicative of how much air is in the master cylinder. This isn't necessarily bad inofitself, but when the brakes go to nothing in this position it's probably time to bleed. Inconsistent mostly relates to worse brake performance under hard and/or constant use.