There are a number of stories about where 4:20 comes from.

One of the most widespread is that 420 used to be the /California|Monterey|Oakland|anyplace in Cali/ police code for marijuana smoking in progress. This is simply not true. Phish.net and 420.com both say that 420 is not the police code for anything anywhere.

They seem to support a story that a group of stoners from San Rafael calling themselves the Waldos came up with it around 1971 as a code for them to use during high school for anything pot-related when they couldn't talk about stoner stuff in front of parents or teachers. However, at this point the stories diverge. Phish.net claims that 4:20 was the time of day that the group would meet at a statue of Louis Pasteur to smoke. 420.com has a much more elaborate story. The Waldos got a map to a pot patch, and they agreed to meet at 4:20 at the Louis Pasteur statue to go look for it. They never found the patch, but had lots of fun looking, and started using 4:20 as a code for smoking. The Waldos were huge New Riders of the Purple Sage(Jerry Garcia's country band) fans, and 4:20 spread from them to the NRPS crowd, who spread it to the Dead crowd, which is everyone, which is why 4:20 is now universal slang for anything pot related.