You can think of long as a version of want/desire. I don't think you've used it grammatically correctly, it should either be:
I long to drink a cup of coffee
or
I long for a cup of coffee
It's a more forceful desire than is conveyed by like (as in your second sentence) or want.