It depends on whether there is a family history of allergic disease e.g. asthma, excema, food allergy, etc. Where there is a family history it is advised to avoid nuts/nut products until the age of 3. If there is no family history they are considered ok to give from 6 months.
From babycentre:
The government's COT report (Committee on the Toxicity of Chemicals in Food, Chemicals in Food, Consumer Products and the Environment) recommends that women who have a family history of allergic disease (or who have a partner who does) may wish to avoid peanuts and peanut products while pregnant and breastfeeding to reduce the risk of their baby developing a peanut allergy. Allergic diseases include asthma, eczema, hay fever and food allergies. It also recommends that babies from families with a history of allergic disease stay on a peanut-free diet until the age of three years.
If you have a family history of allergic disease, you may also choose to exclude all nuts from your baby's diet, not just peanuts. The reason for this is that, if a child is allergic to peanuts, they may be allergic to some other nuts. This is because the proteins found in peanuts and other nuts have a very similar structure.
If you have no family history of allergic disease, these recommendations do not apply and peanuts can be included in both your own and your baby's diet. In fact, peanut butter can be a useful weaning food. It is highly nutritious, and a good source of protein, particularly for vegetarian and vegan babies.
If you are using nuts in your baby's or toddler's diet, do make sure they are ground or processed into small pieces, so that your baby can't choke on them. (Children under five should not be given any whole nuts because of the risk of choking.)
If you do not have a history of allergy in the family, you can give your baby ground nuts and nut spreads, including peanut butter, from six months.