The purchase price is just the entry fee. What a car actually costs you shows up over years, across several categories that rarely get factored into the "can I afford this" decision at the dealership.
Often the largest single cost of owning a car, and the easiest to overlook because it's invisible — no bill arrives for it. It's simply the gap between what you paid and what the car is worth when you eventually sell or trade it. Covered in more depth in new vs. used: the real math.
Premiums vary significantly by vehicle — newer, more expensive, and higher-performance cars generally cost more to insure than modest, widely-available models. Get an insurance quote for a specific car before buying it, not after; it can meaningfully change the real monthly cost.
Compare a vehicle's fuel economy or electric range against your actual driving habits, not just the sticker rating, which is measured under standardized conditions that don't always match real-world city or highway driving.
Routine maintenance (oil changes, tires, brakes) is fairly predictable. Repair costs are less so, and vary a lot by make — some brands are known for costing significantly more in parts and labor than others, independent of how reliable they are.
Annual registration fees, and in some states, property tax on vehicles, vary widely by state and sometimes by county. Look up your specific state's fee structure rather than assuming it's negligible.
Two cars with the same purchase price and similar loan payments can have very different total costs of ownership once insurance, fuel, and expected maintenance are factored in. It's worth comparing total cost, not just the loan payment, when narrowing down between a few options.
See also: the affordability calculator for a starting budget based on your income before you start comparing specific vehicles.