"Playing it by ear" is a figurative phrase - not literal - that can mean two different things.
In the musical sense, it means being able to play a piece of music from memory after having heard it. The person who can "play it by ear" can reproduce music without looking at the sheet music.
Example: Eddie Vedder never took any music lessons. He was just able to play the guitar by ear.
There is also a second, more modern meaning. To "play something by ear" can also mean to do something in an impromptu manner, without a plan. Other words that can be used to describe this exact behaviour are improvise, ad-lib, and winging it.
Example: When I go on vacation, I don't really plan ahead my activities. I like to play it by ear.