From the numbers itself it denotes the number of speaker channels, subwoofers used in the system.
Therefore, in the 5.1 surround system, there are 6 channels. Five are speakers and 0.1 refers to a subwoofer.
On the other hand, in the 7.1 surround system, there is an 8 channel system where 7 are speakers and a single subwoofer.
In short, based on the number of channels, the 7.1 surround system is better.
However, if the 5.1 channel speakers offer higher output power then than the 7.1 then definitely choose 5.1 over 7.1.