I have an old dachshund, male, that does that too. He is 16! and has done it for a few years now. I think it is comforting to him. In order to keep him from licking the leather couch, I must keep it coved up with a blanket. Several family members don't mind him licking their leg and let him go at it! I can't stand it & he seems to know not to bother trying it with me.
Licking is one of many behaviors that can have a variety of motivations. It's hard to know exactly why your dog is doing it without more information. Try to think about it from his point of view - how is the behavior "working" for him? Does it provide him comfort? Lower his arousal? Result in attention from you?
If he's anxious or nervous then you need to help him be less so - professionals use techniques called counter conditioning and desensitization. You can hire a behavior consultant to help you if the problem is of sufficient concern to you.
Or you can just walk away from him when he does this. Sit down on another piece of furniture a few feet away. If he follows you, you can pet him as long as he doesn't lick. As soon as he licks, get up and move away again.
Or try giving him something else to do - a toy to chew on, and/or an interactive toy that delivers food when he manipulates it. If he isn't interested, that's a sign it probably is anxiety based. So the treatment is to lower his anxiety. You'll likely need someone to help advise you on that.