You get points for forming stable molecules with the atoms you place. The more atoms that are in a molecule, the more points you get for it. You also get bonus points for completing levels successfully, and a speed bonus for clearing the levels quickly.
Your score is also dependent on the skill level you are playing on -- the higher the skill level, the more points you'll score for forming atoms and completing levels.
Bacially, scoring follows simple rules. The bigger the molecule, the better; the faster the molecule is built, the better; and as little stray atoms as possible, the better. Skill level also comes into play, especially with the stray atom penalty. If you are playing on a higher skill level, you will be penalized more for stray atoms.
For the algebraically inclined, here are the scoring formulas:
When you complete a molecule:
(# bonds) x (# atoms) x (multiplier factor) x (skill level)
# bonds = the number of bonds in the completed molecule
# atoms = the number of atoms in the completed molecule
multiplier factor = The value of any multiplier atoms in the molecule
skill level = the factor of the skill level (fresh., soph., etc.)
When you complete a level:
(level bonus) + (speed bonus) - (stray atom penalty)
level bonus = (level number) x (skill level)
speed bonus = the remaining bonus from the level
stray atom penalty = (# of bonds possible) x (level bonus)
The stray atom penalty is the one you want to watch, especially at the higher levels. The potential bonds that are possible of all the remaining atoms are used, so purple atoms (four bonds) are worse than the blue atoms (one bond).