The proximal fracture of the femur and hip is the most common reason for hospitalization in orthopedic departments. In Italy, 115,989 hip-replacement surgeries were performed in 2019, showing the economic relevance of studying this type of procedure. This study analyzed the data relating to patients who underwent hip-replacement surgery in the years 2010–2020 at the “San Giovanni di Dio e Ruggi d’Aragona” University Hospital of Salerno. The multiple linear regression (MLR) model and regression and classification algorithms were implemented in order to predict the total length of stay (LOS). Lastly, using a statistical analysis, the impact of COVID-19 was evaluated. The results obtained from the regression analysis showed that the best model was MLR, with an R2 value of 0.616, compared with XGBoost, Gradient-Boosted Tree, and Random Forest, with R2 values of 0.552, 0.543, and 0.448, respectively. The t-test showed that the variables that most influenced the LOS, with the exception of pre-operative LOS, were gender, age, anemia, fracture/dislocation, and urinary disorders. Among the classification algorithms, the best result was obtained with Random Forest, with a sensitivity of the longest LOS of over 89%. In terms of the overall accuracy, Random Forest and Gradient-Boosted Tree achieved a value of 71.76% and an error of 28.24%, followed by Decision Tree, with an accuracy of 71.13% and an error of 28.87%, and, finally, Support Vector Machine, with an accuracy of 65.06% and an error of 34.94%. A significant difference in cardiovascular disease, fracture/dislocation, and post-operative LOS variables was shown by the chi-squared test and Mann–Whitney test in the comparison between 2019 (before COVID-19) and 2020 (in full pandemic emergency conditions).