Typically used to cover a short. You shorted MSFT at $24. If it goes up a lot, you don't want to be crushed. So you put a buy stop at $27 so that the most you can lose (forgetting the cost of the borrow and commissions) is $3 a share.