The surgical treatment of patients with advanced lung cancer remains controversial. The current study aimed to identify the factors affecting the prognosis of patients with stage IV non-small cell lung cancer (NSCLC) and to clarify the surgery guidelines. A total of 27,725 patients diagnosed with stage IV NSCLC were selected from the Surveillance, Epidemiology, and End Results program between 2010 and 2013. The sex, age, ethnicity, marital status, Tumor-Node-Metastasis stage, radiation therapy received and surgical status of each patient were recorded. Patients were followed up to November 2015. Survival rates were estimated by the Kaplan-Meier method. Single-and multi-factor analyses were performed using the log-rank test and multivariate Cox regression analysis respectively. In the isolated organ metastasis cohort, patients with liver metastasis alone had the worst prognosis, with a median overall survival (OS) of 4 months (liver metastasis vs. other organ metastases; P<0.001). Patients with lung metastasis only had the best prognosis, with a median OS of 8 months (lung metastasis vs. other organ metastases; P<0.001). Furthermore, patients with only one metastasis had the best prognosis, with a median OS of 6 months (single metastasis vs. multiple-organ metastases; P<0.001). The multivariate Cox regression analysis of the isolated-organ metastasis cohort and the multiple-organ metastases cohort revealed that patients who were ≤60 years, female, married, Asian, with N 0 stage, had only bone metastasis, accepted wedge resection or lobectomy of the primary tumor, had surgical procedure to distant lymph node(s), and received beam radiation had an improved prognosis compared with the other patients. Age, sex, tumor type, ethnicity, N stage, number and type of metastatic lesions, surgical treatment of primary and metastatic lesions and radiation therapy are factors which influence the prognosis of patients with stage IV NSCLC. Furthermore, surgery may still benefit these patients.