(written from a Production point of view)
Referenced multiple times in behind-the-scenes documentation about Star Trek, The Beatles were an English rock band. They were led by primary songwriters John Lennon and Paul McCartney. Using an allegory for how the relationship between TOS and TNG might be perceived, TNG writer Tracy Tormé stated, "To some people, The Beatles are just Paul McCartney's band before Wings." (The Fifty-Year Mission: The Next 25 Years, p. 53)
The Beatles and Star Trek became popular at much the same time as each other; as novelist Mark Garland noted, "There was The Beatles, and Star Trek." (Voyages of Imagination, p. 243) Or as Roberto Orci put it, "You know, Star Trek and The Beatles were products of the sixties." (The Fifty-Year Mission: The Next 25 Years, p. 761)
In the final draft script of TOS: "Miri", Jahn was initially described as "perched on an elaborate kid-sized bandstand, complete with the equipment for a Beatles-type trio." Making a bracketed comment seemingly criticizing The Beatles indirectly, the teleplay then stated, "Grandmothers apparently were both indulgent and hard-of-hearing on Earth Two, also." The script additionally characterized Jahn himself as being "dressed as a sort of Beatle, complete with a wig," and pointed out that this was intentional on his part.
The Beatles were also an influence on deciding the look of Pavel Chekov, when he was introduced into Star Trek: The Original Series at the start of its second season. In a memo he sent Casting Director Joseph D'Agosta (dated 22 September 1966), Star Trek creator Gene Roddenberry advised, "Keeping our teenage audience in mind, also keeping aware of current trends, let's watch for a young, irreverent, English-accent 'Beatle' type to try on the show." Later, before casting Walter Koenig as Chekov, Roddenberry ensured that a Beatle-type hairstyle would work on Koenig. (Inside Star Trek: The Real Story, p. 343) Explained Spock actor Leonard Nimoy, "At the same time, The Beatles were a big deal and they had these interesting hair cuts and someone said, 'Maybe we will pick up a bit of The Beatles' audience. We should put a Beatle wig on him.' So Walter came in with his excellent Russian accent and a Beatle wig." 
In a letter Gene Roddenberry sent NBC President Herbert Schlosser (dated 1 February 1968), Roddenberry made a comparison between the popularity of Spock and that of The Beatles, noting, "Spock is the hottest item since The Beatles first hit this country."
Marc Cushman, writer of several Star Trek reference books, likened TOS Season 3 to an altered version of The Beatles, as that season had a reduced budget and its production staff didn't include TOS mainstay writing staffers Gene Roddenberry, D.C. Fontana, Robert Justman, and Gene L. Coon. "When you take them out of the mix, it's like having The Beatles and taking away John Lennon and Paul McCartney," observed Cushman. "'Okay, we still have George [Harrison] and Ringo [Starr]. We're still The Beatles.' No, you're not. You're still good, but not as good, and that's what you have with the third season." (The Fifty-Year Mission: The First 25 Years)
TNG and DS9 episode writer Morgan Gendel attempted to name the TNG episodes he wrote after songs by The Beatles, as an in-joke. Whereas he was prevented from giving "Starship Mine" the Beatles-inspired title "Revolution" (owing to the existence of the TNG episode title "Evolution"), he finally got his wish with the episode title "The Inner Light", named after a different song by The Beatles. (Captains' Logs: The Unauthorized Complete Trek Voyages, p. 248)
An homage closely related to The Beatles was suggested by Michael Piller and originally written into the anti-time past setting of TNG series finale "All Good Things...". The first draft script of that episode at first involved a character called "Sutcliffe", a USS Enterprise-D conn officer who was upset at the perverseness of Captain Jean-Luc Picard in that era, and finally requested a transfer off the ship. This was an in-joke referring to a "fifth" member of The Beatles – Peter Sutcliffe, who likewise left his group on the eve of its greatness. (Star Trek: The Next Generation Companion, 3rd ed., p. 301)
A musical progression intended to be featured in the film Star Trek was likely to have been by The Beatles; at least according to the script for that film, John Lennon and Paul McCartney wrote a musical progression which Spock had to guess the composers of, while in a skill dome on Vulcan.  In the finished movie, this reference seems at least inaudible among many voices in the scene, or might have been cut entirely. The duo of Lennon and McCartney was also cited as an inspiration for the Kirk-Spock relationship by the film's writers, Alex Kurtzman and Roberto Orci.  According to Orci, this was an allusion to the fact that both Star Trek and The Beatles originated in the 1960s. (The Fifty-Year Mission: The Next 25 Years, p. 761)