Peanut butter can make you gain weight if you eat enough of the peanut butter.
But eating peanut butter in moderation and sparingly is unlikely to cause any weight gain at all because you really have to eat a lot of peanut butter for the peanut butter to increase your weight.
If you're trying to lose weight you can still eat some peanut butter such as peanut butter sandwiches but if you add some Jelly to the peanut butter sandwich then the addition of the Jelly to the peanut butter sandwich could cause weight gain if you eat enough of it.
I have eaten peanut butter a lot and still do and have never gained any additional weight from eating peanut butter.
I even continued eating peanut butter sandwiches when I was working on losing weight and I still lost weight while eating peanut butter sandwiches but I also exercised as in walking, jogging and cycling to help shed the weight as well.