Do spells that have an area effect such as Burning Hands and Sleep apply to friendly creatures or is it okay to point the area towards a mixed group of friendly and hostile creatures and not worry for the friendly ones?
Generally, all in the area of effect are effected by the spell.
Areas of Effect are defined on pp.204-205 of the PHB. Nothing in those general descriptions distinguishes between who might be in those areas.
Specifically, let's look at Burning Hands and Sleep:
Burning Hands: "Each creature in a 15-foot cone.... (PHB p.220)" Since your allies are (presumably) creatures, they'd be affected. They get the same save as your opponents, though.
Sleep: "Creatures within 20 feet of a point you choose are affected.... (PHB p.276)" You can certainly hit your allies with this, or even yourself.
But I really want to hit my enemies and not my friends!
Sculpt Spells, as a Wizard in the School of Evocation (PHB p117), is the easiest way to do so. And, as @KRyan points out (thanks!), the existence of this class feature is pretty solid evidence that spells generally can't work the way you'd hoped: your interpretation would moot* the Evocation Wizard's L2 archetypal feature.
Another option, courtesy of @Khashir and @CrusaderJ:
Sorcerer's Careful Spell Metamagic grants your allies a free save if they happen to be inside the AoE (still not as cool as sculpt for damage spells, but directly addresses the point that allies would normally have to roll saves...). I say 'not as cool' because many spells still deal half damage on a save, so, your allies would still burn... a bit. On the other hand, Careful Spell can work on spells which are not Evocations. This includes many spells which inflict conditions on a failed save, but do nothing on a successful save. This would allow you to use spells like Confusion or Hypnotic Pattern even when your allies are already inside the target area.
I'm sure there are plenty of other ways to selectively-target within areas of effect; hopefully some commenters will be happy to remind me--or even edit them in =)
* I hold it as a doctrine of coreset-construction that we should read all rules, when possible, so as not to invalidate other rules. On this point reasonable rules-lawyers may differ.
If you refer to the RAW, typically it will say something along the lines of "each creature takes XdX damage"
Some spells are less specific which would generally come down to what your DM/Group wants to play it by.
For example the classic Fireball. Some DMs rule that it will hit all units in the AoE. Others will say that it should only hit Hostile units as that is where the harmful magics is directed.