https://www.quora.com/U-S-Presidential-Elections-If-a-candidate-drops-out-of-the-race-what-happens-to-his-her-delegatesAlan MacNeill
It depends on several factors.
1. Technically, a delegate is only bound to vote for their candidate if their candidate is actually nominated for the nomination at the convention.
Not all candidates who ran get nominated for the nomination. If a delegate's pledged candidate is not nominated for the nomination, then the delegate is free to vote their conscience.
2. There are two sorts of "Dropping out".
A Candidate can formally withdraw from the race. If that happens, their pledged delegates are automatically freed to vote their conscience.
A Candidate can also just "Suspend My Active Campaign". If they do this, they are still *legally* "Running" for the office, they just are not making speeches and the like. Candidates do this so they can keep their campaign committees open and raise money to pay off campaign debt (fun fact, there are still technically candidates "Running" for election to the Presidency in 2008, their campaigns are working on retiring the campaign debts).
A candidate who is just "suspending" maintains their bound delegates (Assuming they Are nominated for the nomination at the convention, see #1 above).
3. A candidate, when dropping out, can formally endorse and recommend another candidate for the office. If they do that, their delegates are NOT *required* to vote for the other candidate, but it's heavily expected.