When you apply for a new credit card your credit score will be automatically checked by the credit card company.
When your credit score is checked a hard inquiry is put on your credit report which temporarily lowers your credit score by a few points for at least a few months to 6 months.
When you get approved for the credit card and use it correctly and pay the payments on time then your credit score will increase again.
So although a hard inquiry will lower your credit score and affect your credit rating when applying for a new credit card it only affects it for a little while.