How can you recognize a department store bike?
As per @Mikes Answer, but a bit more than fits into a comment.  

Only buy a bike with the brand/model of major components able to  be researched. 

On a Mountain bike, shocks are a dead giveaway, and if rear suspension, look at the shock, although they sometimes don't have a model, the good ones always have a brand. From there, pictures will get you close enough. Also look at the geometry - if it looks like a light weight motorbike it's rubbish (Unless it's a top end down hill rig)....  keep in mind age makes a big difference here, so search teh internet for parts of similar ages.

Brakes - Disk brakes should have a brand/model than can be researched. Rim brakes usually have something, but it's always a bad sign if not. 

Seat / Seat post - worth a look, not a bad sign if no brand. 

Drive train components can be tricky, many shops put an expensive rear derailleur on an otherwise cheap bike (That is all many people look at). Look at the cranks, the front derailleur, the shifters etc. These will usually have model information somewhere.  Wheels and hubs - again look at the brand/model - most came out with labels. 

One useful guide is overall weight - lighter bikes cost a lot more. BUT make sure you compare like for like. No point comparing a carbon frame to a steel frame and assuming the carbon is better because it's lighter.

For a novice stick to a brand/model that you can get the details off the internet. Look for a bike that has signs of light or no use. Everything should work smoothly and reliably. No groans, squeaks, clattering of any sort. The problem is any of these can be a sign of big money or a 2 minute tweak to fix and it takes expert eye to tell the difference.