There are two scoring systems, "modern" and "ancient".  Your modern score is shown vertically.  Your ancient score, when you have one, is shown in roman numerals.
Ancient scoring is very simple: your ancient score is equal to the number of four-ways.
Modern scoring is quite complex.  
You get no points when you put your tile on one of the outer edges.  Otherwise, you get a neighbor-count score, which starts off at 1 for one neighbor, 2 for two neighbors, 4 for three and 8 for four.  
Each time you get a four-way, subsequent neighbor-count scores get doubled.  (E.g., after the first four-way, a two-way match earns you four points;  after a second four-way, it earns you eight.)
Additionally, for the first four-way you get an extra 25 points, for the second 50, and then in sequence 100, 200, 400, 600, 800, 1000, 5000, 10000, 25000 and 50000.  
Finally, you get 1000 points for getting all the pieces on the board, 500 if you get all but one, and 100 for all but two.

Hint: To maximize modern scores, try to get four-ways early in the game.  This is more important than getting all the pieces on the board.