When and from where did "guns" become slang for biceps?
Solution 1:
Why are biceps guns? It doesn't make sense and seems so remote from the literal gun.
It's actually not that remote, if you work in reverse. Arms has a common meaning of weaponry in English. If you were to say small arms you would be specifically referring to guns. Which is funny when you think of the irony.
I found a partial answer on the Straight Dope message board.
The baseball origin is probably correct, according to Lighter. As early as 1929 the NYT was writing "A player's arm is his gun or his wing. A good gun means that the possessor has a strong arm.
That message also includes this snippet:
Then a quote from something in 1973 "Guns--the biceps and triceps part of the arm.
I wasn't able to find a source of that quote, but I did find this from a book published in 1990, but according to the author's website was started in 1979. Some Dance to Remember: A Memoir-Novel of Gay Liberation in San Francisco 1970-1982 by Jack Fritscher.
I found a reference to “Does he have guns like these?” as a quote in a 1989 episode of Married With Children.
I haven't found a direct link from baseball to bodybuilding, rather I suspect the link begins with "pumping iron".
Solution 2:
The Straight Dope discussion of guns cited in ghoppe's answer relies to a large extent on the coverage of the word in J.E. Lighter, Random House Historical Dictionary of American Slang (1994). Here is the complete entry for meaning 8 of gun in that reference work:
gun ... 8. Orig. Baseball. a strong and accurate throwing arm; (pl.) arms; biceps.
[Citations:] {1911 Van Loan Big League 56: He's peggin' 'em [baseballs] down to second [base] like they was shot out of a gun!} 1929 N.Y. Times (June 2) IX 2: A player's arm is his "gun" or his "wing." "A good gun" means that the possessor has a strong arm. 1973 [Malachi] Andrews & [Paul] Owens Black Lang[uage] 79: Guns—The biceps and triceps part of the arm. (Where potential firepower lies). 1978 P[hil] Rizzuto on N.Y. Yankees–Boston Red Sox (WPIX-TV) (June 27): Boy, he's got a gun! 1980 F[ran] Healey & B[ill] White on N.Y. Yankees vs. A's (WWS Radio) (June 20): "Willie Randolph is the ideal lead-off batter. He hasn't got big guns but he's strong enough." "What are guns?" "Arms." 1984 N.Y. Post (Aug. 3) 66: "Did you see the right-fielder throw?...His gun reminds me of Skoonj!"—meaning Carl Furillo. 1989 Married with Children (Fox-TV): Does he have guns like these?
Both the Straight Dope commenter and ghoppe note the 1973 instance from Andrews & Owens as the first cited occurrence of guns in the sense of "the biceps and triceps." Google Books has a copy of Black Language, but the book is available for snippet searches only, and I couldn't call up the quoted language about guns in multiple attempts. The book seems to be formatted as a glossary, so it's not clear how much more information the entry for guns has beyond what Lighter quotes.
Lighter obviously considers the biceps–triceps meaning of guns to be derived from the baseball sense of "powerful throwing arm"—and such a derivation makes sense. But the nature of the transition from baseball slang referring to a particular sporting skill to urban black slang referring to an impressive physical appearance is not documented at all, and I think it is at least possible that the transition may include some third element (such as boxing slang or weightlifting slang) that has not yet been accounted for. It is even possible that this other sense of guns arose independently of the baseball sense of gun. How the meaning of guns in Black Language evolved remains a mystery.