As per ISO/IEC 7812, the length of Credit & Debit Card number can be upto 19 digits.
P - Major industry Identifier
Q - Issuing Financial Institution identifier
R - Account Identifier up to 12 digits
S - Checksum to validate Card Number.
Where PQQQQQ combined are known as BIN number or IIN code.
It is commonly used by merchants to identify the card type and issuing bank of the Credit Card.
It also helps in preventing Fraud. In case the Billing Address and the issuing country of the card is different, it may be a fraudulent transaction. With BIN search they can easily identify such transactions.