From what I have heard it started as a code that kids were using to (perhaps linked with # of fingers showing in a sign) to say that they were going for a 420 so nobody who wasn't "in the Know" would understand what they were talking about.
A widely discussed story says that a group of teenagers in San Rafael, California, calling themselves the Waldos, because "their chosen hang-out spot was a wall outside the school", used the term in connection to a fall 1971 plan to search for an abandoned cannabis crop that they had learned about. The Waldos designated the Louis Pasteur statue on the grounds of San Rafael High School as their meeting place, and 4:20 p.m. as their meeting time. The Waldos referred to this plan with the phrase "4:20 Louis". Multiple failed attempts to find the crop eventually shortened their phrase to simply "4:20", which ultimately evolved into a codeword that the teens used to mean pot-smoking in general.