Stephen Pettigrew built Nvidia Corp.’s legal department from a one-man-show — himself — into a full-fledged public-company team.

But when he got too old, executives demoted and fired him. That’s what Pettigrew, who was 64 when he left Nvidia, alleges in an age discrimination lawsuit filed last month against the Santa Clara, Calif., graphics-chip company.