The presence of interleukin (IL)‐17‐producing T cells has recently been reported in non‐small cell lung cancer (NSCLC) patients. However, the long‐term prognostic significance of these populations in NSCLC patients remains unknown. In the present study, we collected peripheral blood from 82 NSCLC patients and 22 normal healthy donors (NC). Percentages of IL‐17‐producing CD4+T (Th17), CD8+T (Tc17) and γδT cells (γδT17) were measured to determine their association with clinical outcomes and overall survival (OS) in NSCLC. All NSCLC patients were followed up until July 2018. Median follow‐up time was 13.5 months (range 1‐87 months). The 3‐ and 5‐year survival rate was 27% and 19.6%, respectively. We found that Th17 cells and γδT17 cells were significantly increased, whereas Tc17 cells were markedly decreased in patients with NSCLC compared with those in NC. In addition, Th17 cells were significantly positively associated with T helper type 1 cells (Th1), whereas γδT17 cells were significantly negatively associated with γδT + interferon (IFN)‐γ+ cells. High percentages of peripheral Tc17 cells were significantly associated with favorable 5‐year OS (P = .025), especially in patients with early TNM stage (P = .016). Furthermore, high percentages of peripheral Th17 cells were positively associated with favorable 5‐year OS in patients with late TNM stage (P = .002). However, no significant association was observed between γδT17 cells and OS, regardless of the TNM stage. In conclusion, our findings suggest that enhanced Th17 and reduced Tc17 cells in the peripheral blood could be a significant predictor of a favorable prognosis for NSCLC patients.