I am looking to upgrade my racer, I currently have a Bottecchia racer from the mid-80s and it has 14 gears. While looking around for newer racers I noticed that a number of them had 20 gears while other ones had 27 gears. Since I live in Berlin, so pretty flat although with the occasional hill, what would be the recommended number of gears?
Bikes which have 27 gears will have triple chainrings at the front. Three rings can be very useful to give you lower gears, typically when you might struggle at climbing, or carry a load such as when touring. For example, I have an Audax bike which has a triple chainset. Its by no means a thoroughbread in terms of performance, but its suitable for a wide range of rides including multi-day trips.
However if you're looking at a "racer" bike, it is far more common to find just a double chainset at the front. In fact, many manufacturers produce double chainrings which will give you almost the same range of gears (but not quite) as a triple - these are called compact chainsets.
A double chainset will be what gives rise to your existing 14 gears (2 rings at the front, 7 cogs at the back), or the 20 gears (2 x 10) you've seen. In fact both Shimano and Campagnolo (I'm not sure about SRAM, but these three manufacturers dominate the market) now produce 11-cog rear cassettes, which would give rise to 22 gears. But 11-speed cassettes are at the high end of their respective product ranges, and 10-speed is far more common.
Note that while a triple chainset will make climbing easier, that's not to say that climbing is not possible with just a double chainset. Far from it. You'll probably find that most seasoned cyclists (and all professional cyclists I think) will ride with a double chainset.
So in summary in a place with occasional hills, a double chainset will probably suffice. But definitely worth considering the "compact" option too to give yourself maximum flexibility.
The current Shimano Ultegra chainset comes in triple, double and compact variants.