When capital is purchased to increase productive capacity.
A key aspect is that the cost of purchasing capital is considered expenditure and is part of Aggregate Demand. However, the purpose of purchasing additional capital is to increase productive capacity which will influence Aggregate Supply i.e. outward LRAS shift. Distinguishing these two outcomes using AD/AS analysis is a minimum requirement for success at Economics A-level.
The increase in expenditure has an immediate impact (as soon as the capital is purchased) while changes in productive capacity will take longer to emerge (as it takes time to integrate capital into the productive process the impact on output also takes time to emerge).