Unless the description states the target is aware of the spell, it is not automatically aware by default.
Spells only say what they do. If a target knew it was under the effects of a spell any time a spell was cast on it, then illusion spells would be wholly useless.
Since your question is about charms/enchantments, it's worth pointing out that these spells explicitly state when a target is aware. For example, Friends states the target knows it was magically compelled. Charm Person also states this.
An example of a spell that doesn't state this is Geas. At no point does it say that the affected creature is aware that it is under magical compulsion to obey the command. This is important because if you happen to be a Sorcerer, you could cast this as a subtle spell and the affected target would have absolutely no way to tell it had even been targeted by a magical effect.
By and large, the default for all magic effects is that something is unaware until they discover it through some mechanism. For instance, you would automatically see a fireball coming at you because it's not a hidden object. Whereas you may not notice a delayed blast fireball that's hidden above a door jamb as you passed under it. Other methods of discovering a spell is affecting you are things like, "Hey, the whole world is getting a lot bigger! Hmmmm.... I might be getting shrunk by an enlarge/reduce spell." Or, "How come I have hooves and oh my god I'm a goat." when targeted by a polymorph.
At the end of the day, the question you need to ask is, "Does the spell explicitly state that the creature is aware?"
Worthwhile contribution from Rubiksmoose:
"You and your companions might deduce that you were beguiled if evidence of the spell is found. It’s ultimately up to the DM whether you discover the presence of inconspicuous spells. Discovery usually comes through the use of skills like Arcana, Investigation, Insight, and Perception or through spells like detect magic." http://rpg.stackexchange.com/a/92279/28591