At what age do kids understand what advertising or marketing is?
At around age 8 kids understand that ads are trying to sell something. Before that, they take ads at face value and assume they're like any other entertainment -- or maybe even real.
But it's not as if companies wait until kids understand ads to target them. They know that the earlier they hook a potential customer, the better. Kids will encounter more ads as they become more avid users of media. When that happens, help them identify and understand when something is an advertisement.
Try to avoid commercial programming for young kids. Fast-forward through recorded shows, or mute commercials. As your kids get older, talk about commercials, pointing out that not everything they see in an ad is necessarily true.