This English expression is used very commonly in spoken language. It is generally used in fairly informal circumstances.
The expression is used to suggest that instead of having a plan in advance the course of action will depend upon the circumstances at the time. It is used to suggest the idea of spontaneity and that a course of action or plan will be devised on the spot or as you go along.
It is suggested that the expression has a musical origin and dates back to the 16th century. At the time “to play by ear” was used simply in the literal sense of playing a piece of music without a piece of music with reference notes to follow. It was not until the 20th century when the expression was first used not just in relation to music but as a more abstract concept.
At this time it was used in the United States and particularly related to sport. Nowadays the expression can be used in relation to anything although it has not been established when the first instance of its usage in this way was.
An example of this expression in use can be found in an interview by the BBC which took place following the terrorist attacks in Paris in November 2015 with the rock band Stiff Little Fingers. The interview centred around the fact that the band were booked to play a gig in Paris the following week and one of the members is quoted to have said “Obviously, we hope people will come out, but equally you couldn’t blame people for being a bit nervous, so we just have to play it by ear.”