Do you know what spells are in a ring of spell storing?

A character finds a ring of spell storing. Does he automatically know what spells are stored in it? Does he need to attune to it? Does it matter if the character is a magic user or not?

• The same way a character determines what's in any other storage, by querying it: SELECT SPELL_NAME FROM RING_OF_SPELL_STORING – Codes with Hammer Nov 5 '18 at 17:27

The RAW from the item description does not explicitly say one way or the other, but it does seem to imply that the attuned user has knowledge of the spells in the ring.

This ring stores Spells cast into it, holding them until the attuned wearer uses them.

and

While wearing this ring, you can cast any spell stored in it.

The two rules above state that the attuned user can cast any spell stored in the ring. As a prerequisite for being able to use something (a spell in this case) is knowing it exists. As such, knowing which spells are present seems to be implied.

When found, it contains 1d6 - 1 levels of stored Spells chosen by the DM.

This rule would not be relevant if the attuned user could not know which spells were available.

A mechanic where the attuned user knows that there are spells stored, but not what they are breaks down when it comes to casting a spell. Many spells require a target or targets to be cast.

A related post How does a Ring of Spell Storing function? about the mechanics of magic items that confer spell casting is an informative summary.

The spells stored become known during attunement

Does he automatically know what spells are stored in it?

No. The ring specifies that it requires attunement. (DMG. p. 192)

Does he need to attune to it?

Yes. (Or use the identify spell, see below).

Some magic items require a creature to form a bond with them before their magical properties can be used. {snip}
... at the end of the short rest, the creature gains an intuitive understanding of how to activate any magical properties of the item, including any necessary command words. (DMG p. 136-138, attunement)

A key magical property of this item is the spells in it that can be used.

Does it matter if the character is a magic user or not?

No.

While wearing this ring, you can cast any spell stored in it.

Any creature that is attuned to it can use it. The magic item description does not limit the ring of spell storing to spell casters.

Compare the ring's description

rare, requires attunement (DMG, p. 192)

to Robe of the Archmagi, which has limitations on who can use it.

requires attunement by a sorcerer, warlock or wizard (DMG p. 193).

No class restriction on the ring of spell storing.

A spell caster is required to cast spells into the ring once the spells in the ring (when found) are used. That makes this ring a potentially flexible party asset.

While wearing this ring, you can cast any spell stored in it.

You can also find out what spells are in it with the Identify spell

From the Identify spell description ...

If it is a magic item or some other magic imbued object, you learn its properties and how to use them; whether it requires attunement to use; and how many charges it has. You learn whether any spells are affecting the item and what they are. (PHB p. 252)

Anecdotal account: in our first D&D 5e campaign, our party found a ring of spell storing which was first attuned by our 5th level bard. Four different members of the party ended up using that ring, or casting spells into it: the Bard, the Wizard, the Cleric, and our Paladin. It was a great party asset.

Just looking at the ring, no, you don't. If you attune to the ring, so you can use it, you will know. Also, casting an Identify spell on it could tell you before you attune.

Just looking at the ring, you have no way to find out what's in it. Looking at the Identify spell, it's clear that this would tell you (and bolsters the case that you can't tell otherwise, since the spell wouldn't be needed if you could tell without it). Knowing what spells are in the ring is necessary to the ability to use it, so rationally, attunement would bring that knowledge.