Scarf keeps getting wider.. Help

I am trying to knit a scarf I am a beginner I have started this 3 times now i will cast on 31 and end up with 50 on my needles as i go down rows what am i doing please help.

Accidentally adding stitches is a common problem with new knitters. Here’s a thread just for this topic.
http://forum.knittinghelp.com/t/faq-mysterious-extra-stitches-look-here?t=32886

Here are some ideas-

Make sure you are only knitting the stitches on the needle and not the thread in between.

Make sure you have the working yarn in back of the work when knitting and in front when purling.

When moving the yarnbetween knits and purls make sure it is moved between the needles not over or that creates a YO (yarn over) which is an increase.