As established by Dungeons & Dragons, alignment is a categorization system that judges characters based on their ethics and morals, on two axes; an ethical component of law versus chaos, and a moral component of good versus evil. Inspired by the works of Michael Moorcock and Paul Anderson, the alignment system is commonly used to categorize characters across fiction, not just in Dungeons & Dragons.
Law versus Chaos
Law, or Order, is defined as the belief that everything should follow some sort of an order, an system. This implies honor, trustworthiness, reliability, and obedience, but can come at the cost of over-adherence to tradition, being quick to judge, and overall inflexibility. The Lawful often prioritize these rules over freedom.
In contrast, Chaos believes that life can be called random and that the laws that others set up are stifling at best and unnecessary, damaging restrictions at worst. Chaos prioritizes the individual and their freedom over the system, and implies adaptability and flexibility, but often includes recklessness and irresponsibility.
In between both systems exists the neutral, which may lean in either direction but could ultimately go either way, depending on the situation; they do not have any particular opinion favoring Law or Chaos, and will simply go with what suits them best.
Good versus Evil
The conflict between Good and Evil is much more simple and archetypal. Good implies selflessness and altruism, a willingness to sacrifice one's needs for the good of others. Evil, however, does not concern itself with such things, and while Good characters are driven to help others, Evil may be compelled to harm and oppress; even if the harm and oppression is not a part of their goal. They may do it because it is convenient or because they want to, but either way, they do it.
Again, neutral exists between both extremes. Neutral characters have no interest in harming others, yet no drive to aid others either; they are driven by their personal connections and whatever beliefs they may have.
The Nine Alignments
Note: Anyone can feel free to add their own characters to the examples listed here, but be sure to keep things alphabetical.
Lawful Good characters believe that laws exist to further good, that these laws and systems exist to uphold moral systems and are necessary for good. Lawful Good characters are often honorable, fair, honest, compassionate, and work actively against evil, using the systems they support to enforce justice against what they see as harmful elements of society - just as they use it to aid those in need. They believe that some degree of freedom is a necessary sacrifice for a safe, just society.
A common conflict for Lawful Good characters is the struggle between their Lawful elements and their Good elements; the choice between doing the lawful thing and the good thing. There are some who will side with law; there are others who will side with good. And there are others who seek a balance.
Neutral Good characters take the middle route in good, complying with laws when it suits them and rebelling against they believe they are unjust. Even if they work with these systems, they do not feel beholden to them, and simply does the best they can do to help others and spread good as a good person. Law and chaos are just tools for good, and must exist in sync to bring this good, for a healthy balance between individual freedom and just laws.
A character of this alignment may not actively spread good, but simply exist as a good person and do their best when the time for them to help others arises. To them, good is an obligation, or perhaps second nature. Others actively spread good, seeing it as an ideal to uphold and share, and will thus go out of their way to face injustice.
Chaotic Good characters actively reject laws in their pursuit of the right thing and their own freedom, using their own morals and conscience to do what they feel is right regardless of what others and their systems have to say or think about it. To a Chaotic Good character, freedom is necessary for happiness, and they often believe that any sort of legal system is unnecessary for good to exist and prosper, because people will do good when afforded the choice.
For a Chaotic Good character, their top priority may be the pursuit of freedom itself, or the pursuit of goodness. A character who prioritizes freedom simply does good because it suits them and because it is right, and may go against the law in pursuit of their own interests. Characters who prioritize goodness may act in lawful systems even as they resent them, going against them when freedom is on the line. Others still see good and freedom as inseparable, and will reject the law in its entirety.
Unbound by the common good or self-interest, a Lawful Neutral character strictly follows their own system of morals, even when it comes at the expense of themselves or others. Their morals may be purely personal, or they may support and act in favor of the government and its laws, without particular concern for whether or not they are right or wrong. Despite this, they are honest, loyal, and responsible.
Whereas Lawful Good characters may go against the law in the name of good, Lawful Neutral characters do not, as any concept of good does not come into their decision making. They may act in unquestioning obedience to authority, or rigidly follow their own system of morals. Others still may act as the arbiters of these laws themselves.
The True Neutral character does not concern themselves with good or evil or laws and freedom, lacking morals that drive them to do good while not having the interest in going out of their way to indulge their desires, either. They simply live their lives and do what they please, and while they will often rally against evil, it is simply because evil will harm them, not because they feel compelled to do good. If anything drives them, it is their personal connections and relationships.
However, there are some True Neutral characters who, rather than just being disinterested in the moral obligations and systems of others, actively reject them and seek to establish a balance between Law and Chaos and Good and Evil, upholding neutrality itself as an ideal. Animals are True Neutral because they lack any concept of morals and act only to survive.
First and foremost, the Chaotic Neutral character is an individualist who is interested only in their own freedom. While they value liberty, it is their own, and they are often uninterested in supporting the freedom of others. They reject tradition and authority of all kinds, simply because they can, but they do not usually act to topple lawful systems, either.
Even if a Chaotic Neutral character is unpredictable, this does not mean they don't follow any internal logic or act randomly. They can, of course, but the typical Chaotic Neutral character simply just wants to do what they want, unrestrained by any sort of system.
A Lawful Evil character establishes and upholds the laws and systems that a Lawful Good character may, but not out of any desire to do good. They follow the law because the law suits them and their desires, and they will exploit these rules in their best interest while using them to exploit and oppress others. A Lawful Evil character may care about honor, tradition, and loyalty, but not about freedom, or life; they lack compassion and mercy. Many Lawful Evil characters are honorable enough to be more anti-villains than straight villains.
While many Lawful Evil characters have no real attachment to the law and only manipulate the system as a mean to their selfish and/or malicious ends, others uphold the law as an ideal, believing that order is what is important; over goodness, over compassion, over freedom, over life. This type of Lawful Evil character is often convinced they are righteous and their tyranny justified.
Above everything else, a Neutral Evil character is motivated by selfishness. They will follow and use the law when it suits them, and act arbitrarily and without regard for any rules when they want to. Simply said, they are out for themselves, and have no compunctions about doing whatever necessary to advance themselves and satisfy their needs. The archetypal villain who pursues only power and is driven solely by ambition is Neutral Evil.
Neutral Evil characters are often amoral and not actively malicious, only as a means to an end; however, there exists those who are actively and gleefully evil, who happily choose wrong over right and bring only misery to others, with just as little regard for Chaos as Law. Others still are driven by the cause of evil itself and seek to spread evil for this reason.
The Chaotic Evil character is similar in many respects to the Chaotic Neutral character, seeking only to follow their own desires and reject the law wherever it arises. However, the key difference is in evil; what the Chaotic Evil character wishes to do is evil. Where a Lawful Evil character can be honorable and predictable, and the Neutral Evil be bargained with and avoided, the Chaotic Evil is an active agent of malice. Even if they hold no attachment to the concept of evil itself, their actions are inexorably monstrous and often extremely destructive.
A Chaotic Evil character may be a hedonist with unpredictable, purely malicious desires, or devoted to some all-consuming idea of evil itself, or simply unhinged and destructive. They value their freedom over anything else, and will often react violently to anything that infringes on it, but their freedom is used only to harm.
Blue and Orange Morality
Outside of the alignments, which are based on human concepts of Good and Evil and Law and Chaos, there are characters for whom such distinctions simply don't apply. They act with internal logic and often hold strong beliefs, but their actions do not make sense according to any traditional system of morality or ethics. Such a character is essentially alien and incomprehensible.