Transfer of Personal Property
The question is: are you still the owner of the guitar or is your friend now the owner.
If you gifted them the guitar, they are the owner. A gift requires:
- intention to transfer title (you had this),
- delivery of the property (this happened),
- acceptance of the delivery by the recipient (he took it).
At first glance, the guitar is now his.
The concept of a conditional gift is irrelevant once the transfer has taken place - it relates to the promise to gift in the future if some condition is met and, unlike a contract, is not binding. If you have a conditional gift you can decide not to give the gift up until you make the transfer - after that, the item is no longer yours.
You are now trying to make out that the transfer was by operation of a contract. This seems unlikely - see What is a contract and what is required for them to be valid?
In particular I doubt that there was an intention to create legal relations or that the agreement was sufficiently detailed - was he required to attend the class? complete the class? enroll in the class? something else? You may have been clear in your mind that the guitar was for the class - was he? Or did the conversation go like "I'm taking a guitar class.", "Cool, I have a guitar I can give you."
Even if there was a contract and he broke it, you are not entitled to the guitar back. You are entitled to the damage that you suffered by him not completing the class. Presumably, this would be the cost of hiring a competent amateur guitarist to play for you a few times.