Introduction: Diabetic foot is one of the main complications of diabetes mellitus; however, in hospitals of provinces from Perú, the relationship of this condition with hospital stay has not been calculated. Objective: To determine the association between hospitalization time and diabetic foot in three hospitals from Cusco, Perú. Methods: A cross-sectional study of secondary data analysis was conducted. We analyzed the data of patients with type 2 diabetes mellitus admitted to the internal medicine service between January and December 2016, in three tertiary hospitals in Cusco, Peru. Correlation coefficients and p-values were calculated using generalized linear models, with Gaussian family and identity function, adjusted by intervening variables. Values of p < 0.05 were considered statistically significant. Results: Of the 153 patients, 14% (21) had a diabetic foot diagnosis, and their median age was 61 years (interquartile range 56 to 68). Those who had a diabetic foot had on average 20 hospitalization days. A strong association was found between a diabetic foot and the number of hospitalization days (17 days more, p = 0.003); adjusted by six variables. Those patients with a history of hypertension had more hospitalization days (10 days more, p = 0.011) and those admitted to a hospital of the Ministry of Health, had fewer hospitalization days (10 days less, p = 0.032). Conclusion: The group of patients with diabetic foot had a longer hospitalization time. The longer hospitalization time could be due to complications of the disease or difficulties in management.