Q:

How many effective gears do I have on a 21 speed bike? 

I have a 21 speed bike (a hybrid commuting bike).  But AFAIK, this does not mean that I have 21 different gear ratios.  Is there any way to calculate the different gear ratios?  

A:

Answers for a typical 21-speed commuter I could find specs on: 20, 19, 15, 12. 
20 is the technically right answer, 19 is a slightly more technically right answer, 15 is if you take into account gears that are nearly identical, but 12 is the practical usable answer. 
Really, it's going to depend on your exact gear setup. 
At the very least, you really should avoid the big-front:big-back gear, since that's hardest on your derailer. 
So, if you take @jensgram's answer and work it out on a typical bike similar to what you describe ...  I'll take the Trek 7.1FX for my example.   The chainrings in front are 48-38-28t.  In the back it's 14-16-18-20-22-24-34r.   (Numbers are the number of teeth).   I don't know if it's typical on other hybrids, but that jump from 24 to 34 is a little unusual and they market it as a special "megarange" feature. 
If you work out all the ratios (I wrote a sort of little computer program up real quick to do it), the only exact duplicate ratios this gear setup has is 28:14 and 48:24, one of which is one of those extreme ranges it's suggested to avoid.   So this bike actually has 20 unique gear ratios, but since one of those unique ranges is 48:34 that you should avoid, it's 19 usable unique gear ratios. 
If you round to only one digit after the decimal to give you the nearly identical ratios, you get 15 gears:
0.8 28:34
1.1 28:24 or 38:34
1.2 28:22
1.4 28:20 or 48:34
1.5 28:18 or 38:24
1.7 28:16 or 38:22
1.9 38:20
2.0 28:14 or 48:24
2.1 38:18 or 48:22
2.3 38:16
2.4 48:20
2.6 48:18
2.7 38:14
3.0 48:16
3.4 48:14

But look carefully at what front chainrings you use to get those...  If you use the smallest front chainring with only the 3 biggest rear cogs, the middle front chainring with all but the biggest and  smallest rear, and the big front chainring with only the four smallest rear cogs, you get your whole range of gears in a way you can comprehend, but it's 12 really usable gears (you skip 1.4, 2.0 and 2.7 in my above chart; all close enough to another gear)
How many rear cogs it makes sense to use on each front chainring will depend on the exact gearing setup.   But if you play around with it a little you can probably just feel it.   Switch the front chainring to the middle, switch the back to the smallest and feel that gear; then switch the front to the biggest, switch the back in by 2 or 3 gears and see if it feels about the same.   Do the same thing with the low-end. 

A:

Excluding the two extremes (see Scott Robinson's answer), you have 19 ratios.  Some of these may be very close to each other.  The easiest way (although a little cumbersome) is to count the number of teeth (n) on all gears (three in front, seven rear) counting from the centerline of the bike (outwards).  The ratio is given as n(front) / n(rear), e.g.:
1st = n(front1) / n(rear1)
2nd = n(front1) / n(rear2)
...
8th = n(front2) / n(rear1)
...
21st = n(front3) / n(rear7)

Now you may find identical (or nearly identical) ratios.  The number of unique ratios is the number of effective gears. 

A:

There's no way to calculate the actual gear ratio unless you know the sizes of the cassette and chainrings. 
But, you do have 19 effective gear ratios since you shouldn't shift into the two extremes. ( Low front/low back, high front/high back)

