Generally there will be a recommendation from the aircraft manufacturer as to the ideal placement of seating however, the final seating arrangements are determined by the airline buying the aircraft – not the manufacturer.
So if the airline’s objective, for example, is to fit as many passengers as possible on board the plane, they will likely disregard the manufacturer’s standard layout and opt for a seating arrangement with rows much closer together.
This is especially the case on planes that are used on domestic routes where the flights are relatively short and passengers are more likely to choose a carrier based on lowest price.
So why don’t they build in the windows to match the planned seating configuration?
Commercial aircraft manufacturers design their planes with the size, shape, and placement of the windows retaining the structural integrity of the aircraft.
After the airline takes delivery of the plane they could potentially change its seating layout several times over the course of its working life.