A CVV is not always 3 digits; it can be 4 digits on some cards. Although most credit cards and debit cards have a 3-digit CVV located on the back of the card, American Express cards are the exception, with a 4-digit CVV on the front. Visa, Mastercard, and Discover cards all use a 3-digit CVV.
The CVV is required anytime you cannot provide a merchant with a physical card, such as an online or phone purchase. This security code is necessary because it allows the merchant to confirm that you have the card with you at the time of the purchase.