When do children learn what lying is?

Age & impact varies. Early childhood is marked by fantacy & imagination, lies equate to bad choices often made spontaneously as a coverup. As the tooth fairy and santa fade from their belief system at 6 to 10, they are integrating thoughts & understand right & wrong with black & white clarity, so lies are more important. The mid to late teen years are marked by more understanding and can be considered like adults.
4- 5 years. At this age children may lie, although the purpose may not be malicious. Children, for awhile, blur the definitions between reality and imagination as they learn what is real and what isn't. They may at first think of lies as stories, as imagination. However it is important to begin teaching the value of honesty and trust during this time.
Kindergarten age. After age 5 years, children have a better understanding of the difference between real events and things imagined. Everyone lies sometimes, and there are many degrees and types of lying. For example, child may create new details to add to a real event to make his storytelling exciting, or he may make up an event to get himself out of trouble.