Inheritance is to be preferred if:
- You need to expose the whole API of the class you extend (with delegation, you will need to write lots of delegating methods) and your language doesn't offer a simple way to say "delegate all unknown methods to".
- You need to access protected fields/methods for languages that have no concept of "friends"
- The advantages of delegation are somewhat reduced if your language allows multi-inheritance
- You usually have no need delegation at all if your language allows to dynamically inherit from a class or even an instance at runtime. You don't need it at all if you can control which methods are exposed (and how they are exposed) at the same time.
My conclusion: Delegation is a workaround for a bug in a programming language.