When do supply and demand curves shift? Let's assume that the price of apples has risen and that the quantity of apples sold during the last couple of weeks has decreased. From that, we can infer that the supply curve must've shifted to the left.

I still have trouble fully understanding this. I was told that when the endogenous variables, such as price and quantity, change, only a movement on the demand/supply curve happens and when exogenous variables change (demand shocks etc.) the curves themselves will shift to the left or right.

In this example a price increase takes place, so we're just moving up the demand curve, no? And when we reach the target price level, there'll be a corresponding quantity. And now because of market equilibrium the supply curve has to reach that spot, too? So it shifts to the left? Is that correct? So in a demand - supply model, there can't be singular movements on the curves, as there will always be immediate reactions that seek to recreate the equilibrium?

Edit: Thanks for all the answers!
Supply and demand curves are a function of price and quantity.  If anything else changes other than P or Q that is relevant to the curve, the curve shifts.

For supply, these shifters generally fall into three  categories:  


Technology  
Number of producers
Price of inputs


For demand: 


Number of buyers 
Price of complements or substitutes 
Customer tastes and preferences
Consumer income


If you come up with something that didn't fit into these categories, but is not P or Q, the result is still a shift! You probably just need your imagination to squeeze it into one of these 7 formal categories.  For example, if the supply curve was P=2Q+3, and there was a decrease in the cost of inputs, the demand curve could shift to P=2Q+2.  Note how the price levels are lower at every level of Q.

Changes in supply and demand that are not "shifts" are called "slides along the curve". They are any direct change in P or Q. This is easiest to see with a linear, mathematical example. 

Let us say the government wants to set the price of a product. If P=2Q+3 is the supply, then consider that if you set the price (by law) to be 7, then Q is now 2. The curve remains steady, but we slide along it to get to the new P=7, Q=2 position. From wherever P and Q started (P=12 in the example), we now end at point P=7,Q=2, and the curve remains unmoved along the entire line P=2Q+3.