Open source licensing is hard. You don’t want to have to deal with all that. The guide below should make it pretty easy.
There are two basic license families to choose from: copyleft and non-copyleft licenses. Copyleft license are those licenses that require you to share modifications you make. The Creative Commons ‘Share Alike’ licenses are copyleft licenses because derivative works you produce have to be shared under the same license as the original.
The best example of a copyleft license is the GNU General Public License. There are two versions in wide use: either the current version, version 3, or the older version 2. The two are incompatible, and are different. Richard Stallman, the author of the GPL and the founder of the free software movement, has a list of the differences and the reasons you might want to choose v3 over v2.
If you want a non-copyleft license, that is, you want a license where modifications do not have to be released as with the GPL, the absolute simplest you can possibly use is the MIT License. I encourage you to do so because simple licenses are generally preferable to more complex licenses.
For most cases, the choice of license will boil down to copyleft or non-copyleft, and either one of the two GPL licenses or the MIT license.
But it’s not that simple. There’s sometimes cases for using other licenses.
If you are in a language community where there is a widely used license of choice, you may wish to just follow that use. If in doubt, ask that community. For instance, if you are building a plugin to work with some existing software, you probably should release it under the same license as used by other plugins.
For web applications, there is a version of the GPL called the Affero GPL which ensures that you have to abide by the spirit of the copyleft/’share alike’ principle by releasing modifications you make to versions you are offering as a web service.
It is possible to release code under multiple licenses.
You are also able to release code into the public domain (although you may wish to use CC Zero for this, as in some countries it is not possible to release material into the public domain).
Documentation and other stuff
If you have separate documentation (that is, say, manuals, handbooks, design documents, a wiki etc.) it is best to release that as either public domain/CC Zero or under either the Creative Commons Attribution or Attribution-ShareAlike license. These are maximally compatible with other freely released text.
Images and other material should be also licensed likewise.
If you release your documentation and imagery under either public domain/CC0 or Creative Commons Attribution or Attribution-ShareAlike, it becomes compatible with Wikimedia wikis like Wikibooks and Wikiversity, and other projects which may wish to host and translate material.
Things to avoid
Do not use free content licenses (that is, licenses intended for use on text, images, audio and video recordings, like the Creative Commons licenses) for code: use the equivalent software license.
Don’t make your own custom license unless absolutely necessary. (It probably isn’t.)