It is common practice to replace a toothbrush after about three months. However, you can prolong the life of your worn-out toothbrush by simply trimming the bristles. You can trim them a little or a lot to get varying degress of hardness (in fact you could even trim a new, soft brush to make it harder). Even if you get a new brush, you can keep the trimmed brush on the side for dealing with those tough-to-clean moments when you need a harder brush to scrub away stubborn coffee or chocolate build-up. (If you normally brush hard, then remember to brush softer since the shorter bristles are already harder.)
One thing to note is that any contouring of the bristles will be lost by a simple cut unless you specifically cut it (which you can do however you like regardless of whatever contouring the brush originally had).
Keep in mind that wearing-down of the bristles is only part of the reason that you are encouraged to change your brush; the other reason is germs. After a while, toothbrushes tend to accumulate germs, especially for people who don’t take much care in keeping them clean. You can deal with this by putting the toilet seat down before flushing (duh), using a toothbrush cover (though you will want to vigoursly shake the brush dry before putting it on to prevent mold), keeping the brush in a medicine cabinet or even another room (do not use those brush holders where the brush is slid into a hole and the brush head comes into contact with the open, exposed base).
Rinsing it with boiling water once in a while is extremely helpful and when combined with trimming the bristles can extend the life of a brush by quite a lot. (Yes, toothbrushes aren’t exactly expensive, but why waste? More importantly, it’s hard to find a good, firm, scrubbing brush for those stubborn coffee stains and plaque splotches.)
Finally, even when a tootbrush is of no hygenic use, it is still of use for cleaning. Brushes are the holy-grail of cleaning equipment and can make many cleaning tasks much easier than with a sponge, cloth, etc. In fact, toothbrushes are absolute gold when it comes to cleaning nooks and crannies. (Of course you will want to wash the brush first.)
It’s good to keep an old toothbrush in the toolbox or cleaning bucket.