Here's a breakdown of the major choices:
Public domain: Other people may do whatever they like with your code, such as including it in closed source applications without giving credit. Examples of these licenses are the Unlicense and the WTFPL. It's generally not recommended to simply write a message saying that the code is in the public domain, because "public domain" means different things in different jurisdictions. The Unlicense, for example, explicitly states what the scope of the relinquishment of rights is.
Permissive: Other people may do whatever they like with your code, as long as they include the text of your license in the finished product, which usually includes the name of the author(s). It's also customary to include a message to the effect of "this software contains code from the project Foobar written by J. Random Hacker". These licenses typically include a disclaimer intended to protect the author from any damages caused by the software. E.g. imagine that, due to a bug, your application hoses the file system of a company's server. Without such a disclaimer, you could potentially be sued.
There's quite a few of these licenses: BSD, MIT, zlib, Boost, Apache, etc.
Some permissive licenses specifically forbid certain uses of the software, such as for commercial purposes, or in the development or operation of nuclear technology. Note that such licenses are incompatible with the GPL.
Copyleft: Other people may do whatever they like with your code, but in some circumstances they may be forced to release their own code under terms at least as permissive as yours. The biggest examples of this type of license are the GPL (mostly version 2) and LGPL. The major difference between the two is that the LGPL allows closed source applications to dynamically link to LGPL code, while the GPL doesn't allow any kind of linking with closed source applications.
See
https://opensource.org/licenses/category