|The Virgin Mary sits a-knitting in this|
14th-century painting in Siena by Lorenzetti
Like with naalbinding, our earliest examples of knitting come from Egypt, where the dry climate and soil helped to preserve archeological finds. They were a product of Muslim culture, whose artistic patterns follow such traditions that we can date items by their style of decoration. (Early knitting used cotton and wool. Both could be dyed, resulting in multiple colors and elaborate patterns.) In Egypt, we have pieces of true knitting that date to as early as the 8th century CE.
In Western Europe, the earliest examples of knitting come from Spain. A set of 13th-century bishop's gloves and two cushion covers knitted in silk are found in the Monastery of Las Huelgas.
The earliest examples of knitting also show a "jog" in the pattern which suggests to experts (knitting experts, not archaeologists) that early knitting like early naalbinding was done in the round. Because of this, knitting was best used for smaller items that curved, such as gloves or mittens, socks, hats, and small bags or purses. Examples of back-and-forth knitting don't show up (at least, none have survived) earlier than about 1600. That is when we start seeing larger items of clothing, like knitted jackets, made from flat pieces that result from a two-needle back-and-forth knitting technique. We know, however, that knitting was regularly producing garments before 1600: a British Parliamentary Act of 1552 that limited the selling of wool mentions knitted shirts.
The artist Ambrogio Lorenzetti, whose art happens to provide examples of everyday living (as in this post on the hourglass), shows the Virgin Mary knitting in a 1345 painting.
*This is all different from crocheting, which did not show up until the 19th century.