Definition: A Jedi Master, as the name implies, is one who has attained mastery of the Force. Although the first Jedi Master to appear was Obi-Wan Kenobi in A New Hope, the title wasn't explicitly used until Luke trained under Yoda in The Empire Strikes Back.
In-universe: Jedi Master was the highest rank in the Jedi Order, and as such was reserved for the most talented. A Jedi Master needed not only superior combat skills, but superior knowledge and wisdom in the ways of the Force. Even Jedi as powerful as Anakin Skywalker might not become Jedi Masters if the Council felt they were not mature and balanced enough.
During the periods when the Jedi Council had centralized control over the Order -- most of the time between 4,000 BBY and the Jedi Purge -- the Council had strict standards of who could become a Jedi Master. The most common test was to train more than one Padawan to Knighthood. The Council could also bestow the title of Master on someone who passed a significant Trial, much like the Jedi Trials to become a Jedi Knight, or performed an extraordinary service for the Republic. With the exception of Anakin Skywalker (and, temporarily, Ki-Adi-Mundi), one had to be a Jedi Master to get a seat on the Jedi Council.
Before 4,000 BBY and after Luke Skywalker reestablished the Jedi Order, the process of Jedi training was much more informal and decentralized. In the early days of the Jedi Order, Jedi Knights would declare themselves Jedi Masters once they felt they deserved it, particularly after fighting the Sith. This had great potential for abuse and was strongly discouraged by the Jedi Council.
Luke declared himself a Jedi Master before starting his Jedi Academy, since there was no Jedi Council at the time to give him the title. This action drew criticism, however, because Luke had only trained for a few years. The standard of training apprentices to Knighthood was not generally used in the New Jedi Order; instead, Jedi gained the title of Master either based on Luke's personal assessment of their skill or because of their extraordinary service to the New Republic.
- The Jedi Path: A Manual for Students of the Force by Daniel Wallace (2010)