At a very high level it checks the metadata for consistency, checks the allocation structures for consistency and then checks every table in the DB for damaged pages, bad links and several other things.
As for the time, cannot answer that.
http://sqlskills.com/BLOGS/PAUL/post/CHECKDB-From-Every-Angle-How-long-will-CHECKDB-take-to-run.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability