What's the deal with OP_RETURN and length? It seems like most OP_RETURN transactions include length as the first byte after the OP_RETURN code. Is this specified anywhere?

Also, the length is sometimes the entire length of the rest of the output, and other times, such as with memo.cash, it is only 2, but there are many more bytes than that.  What is it supposed to be?
The length (amount of data to be pushed into the stack) typically comes directly after the OP_ code.

If the byte after OP_RETURN (0x6A) is between 0x01 and 0x4B, that is signaling the amount of data to push into the stack. This is defined in the Script language; a chart can be found here.



For example:

6A24AA21A9EDA45B20BAE4C0D9C747D7C17074D0606AF70FABA1394FC75E5DA6ABDA0426232E

The first byte 0x6A decodes to OP_RETURN and the next byte is 0x24 signaling 
to push 36 bytes of data to the stack. (0x24 hexadecimal is 36 in decimal)

Our example therefore decodes to:

OP_RETURN PUSHDATA(36) AA21A9EDA45B20BAE4C0D9C747D7C17074D0606AF70FABA1394FC75E5DA6ABDA0426232E

If there was any more data after the 36 bytes it would be interpreted in coordination with the proper OP_code.