You're right — it is normal for one or both of a newborn's eyes to sometimes appear to wander, especially when they are fatigued. But, as a baby ages, this phenomenon should stop. By six months old, your baby's eyes should line up and move together all the time. If they do not, this is called strabimus. If an eye deviates outward this is called exotropia, and if it deviates inward this is called esotropia. Eyes can also deviate upward or downward.
The misalignment is often caused by differing strengths in the muscles that control eye movement. Some children are born with this condition, while others develop strabismus when they are older.
Aside from the obvious cosmetic issues, the real concern about strabismus is the confusion it causes the brain, since each eye is taking in different visual input. If this confusion persists for long enough, your child's brain will start to ignore the information being received through one of the eyes, resulting in vision loss.
If you are concerned that your child might have strabismus you should discuss your suspicions with your pediatrician. There are a few tests that they can do in the office but most likely, they will refer your child to a pediatric ophthalmologist for a more thorough evaluation. Strabismus must be treated — it will not resolve without intervention.