With Nikon Dxxxx models, as the four-digit number following the "D" increases, the body get better and better. With their Dx models, as the single digit increases the body gets better.
Keep in mind though, if you put a good lens onto the cheapest Nikon, it will produce better image quality than than poor lens on their best body. Image quality comes from the lens and the user, not the body. The body is just a box that holds the sensor and provides you with the controls/performance needed to get the shot.
Here's a good tool to compare bodies:
http://www.dpreview.com/products/compare/side-by-side?products=nikon_d3200&products=nikon_d3300&products=nikon_d5200&products=pentax_k50&products=pentax_k3