Introduction: Factors other than PD-L1 (Programmed Death Ligand 1) are being sought as predictors for cancer immuno- or chemoimmunotherapy in ongoing studies and long-term observations. Despite high PD-L1 expression on tumor cells, some patients do not benefit from immunotherapy, while others, without the expression of this molecule, respond to immunotherapy. Attention has been paid to the composition of the gut microbiome as a potential predictive factor for immunotherapy effectiveness. Materials and Methods: Our study enrolled 47 Caucasian patients with stage IIIB or IV non-small cell lung cancer (NSCLC). They were eligible for treatment with first- or second-line immunotherapy or chemoimmunotherapy. We collected stool samples before the administration of immunotherapy. We performed next-generation sequencing (NGS) on DNA isolated from the stool sample and analyzed bacterial V3 and V4 of the 16S rRNA gene. Results: We found that bacteria from the families Barnesiellaceae, Ruminococcaceae, Tannerellaceae, and Clostridiaceae could modulate immunotherapy effectiveness. A high abundance of Bacteroidaaceae, Barnesiellaceae, and Tannerellaceae could extend progression-free survival (PFS). Moreover, the risk of death was significantly higher in patients with a high content of Ruminococcaceae family (HR = 6.3, 95% CI: 2.6 to 15.3, p < 0.0001) and in patients with a low abundance of Clostridia UCG-014 (HR = 3.8, 95% CI: 1.5 to 9.8, p = 0.005) regardless of the immunotherapy line. Conclusions: The Clostridia class in gut microbiota could affect the effectiveness of immunotherapy, as well as the length of survival of NSCLC patients who received this method of treatment.