From Ultracompact to Extended H II Regions. II. Cloud Gravity and Stellar Motion