A toothbrush that is unused and not open does not expire.
However once you open the toothbrush and use the toothbrush it should be replaced every 3 months to 4 months of use.
Toothbrushes wear down on the bristles and the bristles of the toothbrush can become worn and frayed and make it less effective in cleaning your teeth.
Overtime toothbrushes can even collect and grow bacteria even when it looks clean.
Also if you've brushed your teeth when you've been sick with the cold, flu or other virus or illness you should replace the toothbrush as you could catch the illness again.
You can keep toothbrushes in their packaging for several years as spares and they never go bad.
However if they are out of their package the bristles may start to dry out and go bad and collect dust and bacteria.
You should also always rinse your toothbrush under some hot water after use to help remove bacteria that can gather on the toothbrush after brushing your teeth.
If you brush your teeth more aggressively then the toothbrush may wear down quicker and need replaced sooner.
But for the average person a toothbrush should last 3 to 4 months.
After 4 months you should replace the toothbrush even if it looks good.