It's short for either "am not" or "are not", depending upon the context. Correct spelling is "ain't."
And, of course, despite its very common and frequent usage, it's still considered incorrect grammar.
Oh, but ... it follows. It follows. It's a generic contraction that regularized, starting with 1st person singular BE, then 2nd and 3rd, then all persons and numbers BE, then moved on to the other two major auxiliaries, HAVE and DO.
1706, originally a contraction of am not, and in proper use with that sense until it began to be used as a generic contraction for are not, is not, etc., in early 19c. Cockney dialect of London, popularized by representations of this in Dickens, etc., which led to the word being banished from correct English.