This was posted on 4-9-2010 by adamwho in response to a similar question. It seems to be quite accurate when I tested it then.
For 5x5 games
Points = -(1/3)*time_in_sec + 535
For 4x4 games
These are on the line:
Points = -(1/3)*time_in_sec + 375
This of course, is not the whole picture since even really terrible finish times give some points, so it is likely that the scoring is not a single line but piece-wise continuous.