Decks need to be replaced when they become unsafe, typically from wood rotting and losing it's strength. Wood will usually rot first where moisture is being held the longest. Look for rotted deck floor boards, and rotted posts, especially at the bottom ends if the wood posts extend down into the soil. It may be helpful to use a small flat head screwdriver or an awl to probe the wood.
If the wood is still in good shape, you may not need to replace the deck - to prolong it's life you can paint or stain it.