The reason that a Linux distribution is "free" is that many of the pieces of software it includes are covered by the GNU General Public License (GPL for short).
There are two different types of "free":
freedom to see and modify the source code ("libre")
free of charge ("gratis")
The GPL is about the first "freedom", not the second.
Provided Red Hat release the source code, then they are probably complying with the license.
The version numbers correlate between RHEL and CentOS (as Ben Preston already answered). Moreover, due to RHEL philosophy, the ABI should stay the same across all minor number ( .x) versions, so the package compiled for 5.4 should most likely work for 5.5 and 5.6 as well.
CentOS 6.5 is based on RHEL 6.5; prior to CentOS 7, CentOS versions exactly match RHEL versions. The pattern changed with CentOS 7, which uses something like a build number: CentOS 7 (1406) is based on RHEL 7.0, CentOS 7 (1503) is based on RHEL 7.1, etc. You'll find all the details on the CentOS wiki (look for the "Archived Versions" section).
Best Answer
The reason that a Linux distribution is "free" is that many of the pieces of software it includes are covered by the GNU General Public License (GPL for short).
There are two different types of "free":
The GPL is about the first "freedom", not the second.
Provided Red Hat release the source code, then they are probably complying with the license.
Further reading:
References: