The simple answer is when they are foreseeable.
An example would be a service provider fails to properly service equipment for a manufacturer. As a result, the manufacturer must shut down for a few days until the equipment is fixed or even replaced. The manufacturer could potentially recover lost profits because it was foreseeable that a failure in the equipment caused by improper servicing by the service provider would lead to lost profits.
However, lost profits can get expensive, fast. Thus, a business startup should take heed when contracting.
Often times, a contract will attempt to exclude lost profits. In fact, both parties might bargain for exlcluding lost profits--otherwise they might not want to conduct business with each other. That being said, the manner in which the exclusion is drafted can depend on whether lost profits are in fact excluded under a contract.
The Boulder business lawyers of LaszloLaw provide some answers to how and when profits can in fact be excluded under a contract.