Your dog curls up on your lap. A family member comes over, and the dog stiffens or growls. It may feel as if they are protecting you, but they may be worried about losing a comfortable place. Whatever the reason, don't let someone keep approaching to see whether the dog "means it."
Pause close contact when people need to move around. Give your dog a separate, comfortable bed and invite them there before someone approaches you. Do not lift or push a growling dog off your lap. If they have snapped or bitten, or children are nearby, use barriers and seek veterinary and qualified, reward-based behavior help. A new reaction also deserves a health check.
Teach a happy exit at easy times
When nobody is approaching, teach a cue such as "off" or "come" and reward your dog for stepping down willingly. Let them return to a comfortable place sometimes, so the cue does not always mean all affection ends. Practice with a person moving in the room only at a distance where your dog stays relaxed. If they stiffen, the exercise is too hard, reset with more space.
Keep greetings and hugs between people separate from lap time while training is underway. You are not trying to prove who owns the chair or the person. You are helping the dog learn that they can move and still have good things, without needing to warn anyone away. For more on guarding a person or resting place, see the resource-guarding guide. Prevent close approaches and get individual help if anyone could be bitten.
Sources: American Veterinary Society of Animal Behavior: Grrr... This Lap Belongs to Me!. Dogs Trust: Resource guarding in dogs.