The maturity period is set by the terms of issue and determines when an investor receives the principal back. Bonds are typically divided into short-term, medium-term, and long-term, although the specific boundaries are conventional and vary across markets.
Maturity affects both yield and risk simultaneously. Longer-term issues typically offer higher yields as compensation for greater uncertainty and capital being tied up for longer. At the same time, they are more sensitive to repricing when rates change — this sensitivity is more accurately measured by duration, which accounts for intermediate payments.
The stated maturity does not always coincide with the actual maturity. The presence of a call option or amortization changes the real investment horizon, so yield is calculated to the nearest possible redemption date rather than the formal maturity date.
A practical approach is to match the maturity to your own investment horizon. A security that matures after you need the funds will require selling on the secondary market, and with low liquidity this may prove difficult or disadvantageous.