Utility is a generic term used to specify how much a certain action gives results according to an agent’s preferences. Its unit – util or utilon – is an abstract arbitrary measure that assumes a concrete value only when the agent’s preferences have been determined through an utility function.
It’s a concept rooting from economics and game theory, where it measures how much a certain commodity increases welfare. One common denominator for utility and the clearest example, especially in this field, is money: the price a person is willing to pay for the satisfaction of his preference. Although it has been argued that utility is hard to quantify when dealing with human agents, it is widely when designing an AI capable of planning.
Utilitarianism is an ethical theory proposing that the appropriate and morally correct course of action in any given situation is the one leading to the maximum utility.