Number one is a title affectionally given to an officer who is second in command, literally because the first officer is, in name, the commanding officer's "number one" man (or woman).
Christopher Pike referred to his first officer as Number One. (TOS: "The Cage")
Captain Picard also referred to his first officer, Commander Riker, as number one. (TNG: "Encounter at Farpoint", et seq.)
After his assimilation by the Borg, Picard (as Locutus) also chillingly referred to Riker as number one. (TNG: "The Best of Both Worlds, Part II")
Doctor Beverly Crusher also once referred to Commander Riker as number one. (TNG: "The Battle")