tl;dr: The term was used sparingly starting around the Fifth Doctor's run, became pretty commonplace by the end of the original series, and became "official" sometime after the 2005 reboot.
The term "companion" is mostly an out-of-universe term used by the production staff to refer to the regular non-Doctor stars of the show. It was popularized mostly by the fan base, though the show's production staff also used it internally. It's now become "official", appearing in BBC media related to the show.
In the older series, the term was not used very regularly. Instead, the early Doctors tended to refer to their cohorts as "assistants". If you ever get to see interviews with the actors and actresses from that era, this is the term they tend to use for themselves.
Around the time of the Fifth doctor, a new production team came on, and the term "companion" started to be used, shortened from the phrase "travelling companion". The general idea was that "assistant" might be considered a bit condescending. They wanted a term that did not impose and kind of value judgement on the relationship between the Doctor and their companions, but merely described it: they traveled in the TARDIS together.
By that time, the Doctor's companions had started to take on a more equal role in the show: they weren't just there to do what The Doctor told them. There's even a scene in "School Reunion" where Sarah Jane calls Rose an "assistant" and she gets pretty offended. This is meant mostly as an in-joke, since Sarah Jane would have been referred to almost exclusively as an "assistant" during her initial run.