Alignment is based off of ones actions. If you tend to steal, kill, or just all around not care for another persons well being, you may find yourself marked as such. The opposite is also true.
There a few alignments one might strive for, those being Good, Evil, Lawful, and Chaotic.
For a thorough explanation see: Alignment in Dungeons and Dragons