According to the PostgreSQL documentation:
identifiers…identify names of tables, columns, or other database objects.…
The system uses no more than
NAMEDATALEN-1bytes of an identifier; longer names can be written in commands, but they will be truncated. By default,NAMEDATALENis 64 so the maximum identifier length is 63 bytes.
You can see this limit using the query suggested by this comment: SELECT length(repeat('xyzzy', 100)::NAME); creates a 500-character string and casts it to PostgreSQL’s NAME type, then checks the length. The result is 63.