WordPress is licensed under GPLv2 (GNU General Public License) which makes it free and open-source software. Each copy of WordPress has a license copy with it.
Predecessor version of WordPress b2/cafelog was also licensed under the GPLv2.
GPL is very popular in licensing open-source software under it. It allows free installation, modification and distribution of its source-code to others. Although, it maintains some rules and regulations under it.
Here free is referred to freedom and not price. It may apply some minimal charges on certain stages.
What is GPL
GNU software was written by Richard Stallman.
The GNU General Public License is called GPL in short. It has some terms and conditions to copy, modify and distribute the software licensed under its name.
GNU makes sure that any software source-code licensed under it has to make originating source code open and freely available to all its users. Here, freely doesn't mean by cost but it means that it is freely available to users to distribute and modify the code, but they can't impose any restrictions on further distribution, source code has to be made available.
Software allowing these facilities comes under the category of Free Software. And if those rights need to be retained, then these are called Copylefted. The GPL demands both.
On 29th June 2007, the third version GNU GPLv3 (version 3) was released. It was discovered to deal with some problems that were present in the second version.
Updating GNU version is optional.