A child at age 2 years old can begin to grasp the shapes but it's not usually until around age 3 when the child can really know their shapes.
Knowing and naming shapes is a skill that takes a child a bit longer to master than other skills but they should start knowing shapes as early as age 2 and by 3 and even 4 years old they should fully know their shapes.
I bought my kid a shape sorting toy that he was able to put the shapes into the bucket through the holes that fit the shapes.
I also used to sit down with him at the table and show him shapes and tell him what those shapes were and at 2 years old he could tell me what a few shapes were.
But after age 3 and 4 he was able to name every shape that I presented him with and asked him what the shapes were.