To knit horizontal stripes you need two balls of yarn. The image shows horizontal stripes knitted in stocking stitch.
To knit wide horizontal stripes (more than 4 rows) it is good practice to cut the first colour and join in the second colour. Knit the number of rows needed for your stripe and then cut that colour and join the other colour.
To knit narrow horizontal stripes (4 rows or less) you can carry the other colour, and swap between the two colours as you go, without cutting the yarn.
For advice on changing yarn colour, see how to join another yarn colour.