Roth 401(k) contributions are taxed when they're deducted from your pay and may be withdrawn tax-free in retirement. Any earnings on Roth 401(k) contributions are eligible for tax-free treatment as long as the distribution occurs at least five years after the year you made your first Roth 401(k) contribution and you have reached age 59½ or have become disabled. Roth 401(k) contributions are eligible for company match and are subject to the IRS 402(g) limit.
After-tax contributions are also taxed when they're deducted from your pay and allow you to save beyond the IRS limit placed on Roth 401(k) contributions. Unlike Roth 401(k) contributions, any earnings on after-tax contributions are taxable upon withdrawal unless they are first converted to Roth via the 401(k) plan's in-plan Roth rollover feature. After-tax contributions are not eligible for company match.
Talk to a tax advisor for help deciding which contribution types make sense for you given your retirement savings goals and personal situation.