As in any art there are some basic rules that help you understand what is good and what is not good. In photography there are some basic rules of composition that help you discover why the eye looks to certain parts of a photograph...what draws us to that point? But really, for me, I love to break the rules. And after all, they're just guidelines.
One of the most famous rules of composition is the rule of thirds. Basically you want to imagine that your photo is divided into nine equal segments by two horizontal and two vertical lines. You want to put the point of your focus along these lines or at the points where they intersect.
Another example. At times however, I feel it is fine to break this guideline. Sometimes it works to have your subject right smack dab in the middle.
Another thing to remember in the rule of thirds composition is that if you do not want that sense of emptiness in the rest of the picture, it is sometimes nice to balance out the other space with other elements.
Another guideline of composition to keep in mind is perspective. What are you intending the viewer to see? This is one of my favorites. Do you want to take the picture from up close? Far away? Above? Below? Right on the level? Anyone can just snap a picture but determining what is important in the photo is up to the photographer and your unique "perspective."
The human eye is also drawn to patterns and repetition. You can draw the eye of the viewer by capturing unique patterns and where they end.
Another composition element similar to capturing patterns is the use of the natural line. Our eyes follow lines, we follow lines all day long, so naturally we try to find the source.
Another interesting element of composition is the use of natural frames. This could be a doorway, a window, trees, arches, or anything else that frames an interest.
Depth is also effective. Here there are layered elements that keep the eye moving in the photograph. First the field, then single tree, then tree line, mountains, and finally sky. It would probably be even more effective if there was something more prominent in the foreground.
Cropping is the most direct compositional element. You are simply saying as the artist, this is what I want you to look at. Nothing else is important. And it's quite effective.
Finally, the last composition element is background. Having a simple, non-distracting background lets the viewer enjoy what is in the foreground. Photography is a 2-D art, and so even though our eyes might easily separate what is in the foreground and background, it is harder for a camera lens to do so. Get rid of the distractions either by focus or moving location, so that you can focus on your subject.
Those are some of the main composition elements to think about when you're getting started. You can mix and match them, isolate them, or just plain ignore them if you'd like, but sooner or later they will sneak into your photographs without you even realizing it.