First of all, it's good to understand that "imaginary" is a silly choice of name for a certain type of number. These numbers are neither more nor less "imaginary", in the common language sense, than any other mathematical object.
That said, any number of the form $a+bi$ is complex, where $i=\sqrt{-1}$. Those complex numbers with $b=0$ are called "real", and these include the familiar rational numbers, integers, etc. Those complex numbers with $a=0$ are called "imaginary", and they are precisely those numbers whose squares are non-positive "real" numbers.
Where do they come from? Complex numbers fill in solutions to equations that we could otherwise not solve, and then they turn out to have all kinds of applications. To illustrate what I mean about solving equations, consider that $x^2=a$ has two solutions whenever $a$ is a positive real number, and no real solutions when $a$ is a negative real number. Once we define imaginary numbers, then the equation has two solutions no matter what, with the only unusual case being $a=0$, in which the solution $0$ is repeated twice.
A nice thing about complex numbers it that they provide an "algebraically complete" structure: Any time we write down a polynomial equation, using complex numbers, it has solutions among the complex numbers - exactly as many solutions as its degree.