In addition to Allison's excellent answer, I discovered that other certificate generation tools don't always follow this CN limit like openssl does.
For example: I made a simple self-signed cert and key generation script using Golang, where you can set a CN to be arbitrarily long.
Here is my solution that you can run in your browser or copy the code to modify and execute locally: https://go.dev/play/p/GbdoV0UEmFb
This code will generate a key, sign the cert, and print both out in the output in PEM format (similar to the openssl commands used in this thread). Please read through the comments if considering using this for anything important. Here is proof of the long CN when using openssl to read the generated cert from this script:
$ openssl x509 -text -noout -in playground.crt | head -n 11
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
a8:fd:bf:b8:f3:f9:85:09:36:28:89:fa:65:27:33:ed:19:08
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN = MY REALLY LONG COMMON NAME THAT IS DEFINITELY LONGER THAN 64 CHARACTERS
Validity
Not Before: Nov 10 23:00:00 2009 GMT
Not After : Nov 10 23:00:00 2010 GMT
Subject: CN = MY REALLY LONG COMMON NAME THAT IS DEFINITELY LONGER THAN 64 CHARACTERS