As you can see here, given a normal upward sloping yield curve, you will get a better yield for a longer maturity bond. This is because, the longer a bond has to maturity, the greater the credit, interest rate and reinvestment risk attached to it.
A bond's maturity is usually fixed. However, there are two exceptions to this general rule: Bonds with extendible maturity - usually at the issuer's discretion; and bonds with perpetual maturity - where the principal is never repaid and the only return to the bondholder is in the form of coupon payments.
Even where a bond's maturity is fixed, bonds sometimes include features which allow for redemption before the maturity date. There are three features which can be added to a bond to allow this:
- call provisions: where the issuer has the right to repay all or some of the principal owed to the bondholder on a date before the maturity date
- put provisions: where the investor has the right to demand early repayment of the principal usually on specific dates
- and sinking fund provisions: where the issuer is required to repay a certain amount of the principal on an annual basis up to redemption.
What sort of maturity you are interested in will depend on your own investment time horizon; and also on what you think is likely to happen to interest rates and so the yield curve within that time horizon.