External-beam radiotherapy treatments are delivered by a linear accelerator (linac) in a series of high-energy radiation sessions over multiple days. With the increase in the incidence of cancer and the use of radiotherapy (RT), the problem of automatically scheduling RT sessions while satisfying patient preferences regarding the time of their appointments becomes increasingly relevant. While most literature focuses on timeliness of treatments, several Dutch RT centers have expressed their need to include patient preferences when scheduling appointments for irradiation sessions. In this study, we propose a mixed-integer linear programming (MILP) model that solves the problem of scheduling and sequencing RT sessions considering time window preferences given by patients. The MILP model alone is able to solve the problem to optimality, scheduling all sessions within the desired window, in reasonable time for small size instances up to 66 patients and 2 linacs per week. For larger centers, we propose a heuristic method that pre-assigns patients to linacs to decompose the problem in subproblems (clusters of linacs) before using the MILP model to solve the subproblems to optimality in a sequential manner. We test our methodology using real-world data from a large Dutch RT center (8 linacs). Results show that, combining the heuristic with the MILP model, the problem can be solved in reasonable computation time with as few as 2.8% of the sessions being scheduled outside the desired time window.