Welcome to the world of knitting.
There are 2 ways this can be accomplished (at least, I always hesitate to limit anything, because sure enough some one will know another way). One would be to use a circular needle that will hold a lot of stitches (all you need for the length of the scarf) and knit long rows back and forth, flat with the circular needle. Make each stripe as wide as you want it then change color.
The other way is to work the narrow edge of the scarf, but to use a technique called intarsia for the stripes. There is a video about how to do intarsia in the "advanced techniques", I believe. Don't let that scare you, it is not that hard and this type is the easiest. Basically you use a different ball of yarn for each vertical stripe, you knit the width of the first stripe, drop that yarn and start knitting with the yarn for the next stripe. Keep doing that across. Then when you purl back you drop colors and pick up the one that is next when you come to the next stripe. The only real trick is to be sure you pick up the new color at each change from under the color you drop so that the yarns wrap around each other. If you fail to do that you will have stripes of color, with a space (vertical slit) between each color. You may also have to spend a little time untangling yarns, but it is doable.