The answer depends in part on the context, location, and time frame in which they're being used, but in general, a yeoman is a farmer who owns his own land. He would have lower social standing than a gentleman, who may be independently wealthy and whose income would probably come from managing a business or investments rather than doing the labor himself. In the UK, a gentleman would probably have the right to a coat of arms.
Esquire is more of a title than an occupation, and indicates that a commoner has achieved the social standing of a gentleman.
These are generalizations, but that's basically how they're used in most cases.