Friends and strangers frequently compliment me on how well Lyddie behaves in public. She has an abnormally long attention span for her age, and while I think part of that is personality, I think it's safe for me to take at little bit of credit for this skill, since I have intentionally included activities and plans since an early age for us to work on her ability to sit quietly and entertain herself for stretches of time.
Here are a few excellent resources for how to work on this with your own children:
From the GirlTalk blog: How to teach your toddler to wait by the door when it's time to go bye-bye
From mombyexample.com: Teaching a baby to sit for up to 30 minutes at a time