If you leave your job (voluntarily or involuntarily), you'll be entitled to a distribution of your vested balance. Your vested balance always includes your own contributions (pre-tax, after-tax, and Roth) and typically any investment earnings on those amounts. It also includes employer contributions (and earnings) that have satisfied your plan's vesting schedule.
Full Changing Jobs? Know Your 401(k) Options Article