If I put something in the tx-extra field of a transaction, will it be publicly visible and unencrypted? That is, anyone can see it on the public view of the monero transactions? And I assume the tx-extra field content can be of any length?
Yes, tx-extra can be of any length, as long as the transaction as a whole is not too large to be accepted into a block.
Only the parts of tx-extra that need to be encrypted are encrypted. For example, the transaction public key does not need to be encrypted, so that's just directly in tx-extra. But (the newer style) payment ids do need to be encrypted, so they are encrypted with the transaction shared secret that only the sender and recipient will know, before being put into tx-extra.
If you want to create your own tx-extra subfield and put sensitive information into it, then you'll have to decide for yourself how to encrypt it. If it's a bunch of text, then you'll need some kind of stream cipher. Perhaps use TweetNacl https://tweetnacl.js.org/ to encrypt what you need to store.