Sometimes, and the method varies a lot by retailer and region.
Some companies accept self-certification, where you tick a box confirming you meet the rating. Others apply stricter checks: uploading a copy of photo identification, or matching your details against an established database such as a credit record or electoral roll. Which one you get depends on the store, the payment method and local law.
The inconsistency is the real story here. Age ratings on games are enforced far more loosely than on cinema tickets, and online retail is the weakest link in the chain, which is why self-certification persists at all.
For parents, the practical point is that the checkout is not a reliable barrier. Console and store parental controls, set up in advance, do a much better job than any age gate at the point of sale.