Used constantly of children who will not do as they are told, and of adults who behave the same way.
It is both a na-adjective and a noun. As a noun it names the selfish behaviour itself, which is why it takes を and a verb: わがままを言う is literally 'to say a selfishness,' i.e. to make demands one has no right to make.
Common patterns
Register
usually a criticism, but it is very often turned on oneself as a softener — わがままを言ってすみません, 'sorry to be difficult,' is a normal way to preface an inconvenient request. Said of a child it is mild; said flatly of an adult it stings.
Similar words
自分勝手 is blunter and usually critical, though it too can be used of oneself in apologies (自分勝手なお願いですが). The opposite quality is 素直, being frank and unresisting.
Writing
usually written in hiragana; the kanji 我儘 exists but is uncommon.