This is my first time doing any home brewing. I'm using a Mr. Beer kit my parents got me. It has been fermenting for 3 weeks. So I tasted it yesterday and it still has a slightly sweet taste, which I don't mind.
Is it ok to bottle at that point?
Unless the brew has spent three weeks in a very cold place one can usually say that primary fermentation has been completed in that time.
14 days at "room temperature" or slightly below is sufficient for most fermentation to complete. IMHO the beer is ready to be primed and bottled. It will not be ready to drink before 14 days and will need about 7 of those days at room temperature to carbonate correctly. The beer will improve by standing at least a month in the bottles.
Technically speaking, primary fermentation is deemed to have finished when the specific gravity reading is the same for two days in a row. Although I usually allow 3 days - whats the rush!?
Any beer is OK to bottle when the yeast is at the point where it will not over-carbonate the bottles, putting them at risk of pressure-induced bursting.
At what point is this the case?
The generally recommended practice is when three successive gravity readings show the beer stays at the same gravity, and this gravity is roughly at the final gravity you expected. The readings are usually taken over 3 days. Air lock activity is not a reliable indicator of this because CO2 may be escaping through another point (like around a bung or grommet).
Your kit probably included a hydrometer. This measures the density of the liquid it floats in. It looks a bit like a big glass thermometer. Take a sample of beer, and float the hydrometer in it. Read the number that's right at the top of the beer. Your hydrometer might have other units like Brix as well. Here I'm talking about specific gravity, the amount of dissolved sugar in the beer changes how deep it floats (or sinks). As the yeast processes the sugar, the gravity (density) of the beer decreases.
Just to get some numbers into this - for something like a simple pale ale (starting gravity around 1.050) a final gravity of around 1.012 might be OK. If it was still at 1.020 I would be cautious about bottling - especially in glass.
Everything Barking.pete says is generally true in practice (2 weeks fermenting at room temperature is usually enough). But to be sure it's best to take those gravity readings. Temperature can significantly effect the action of the yeast, so if you're room/garage temperature was 14C it would be typical for fermentation to re-start once the beer warmed up. If your not in your target final gravity, it's much easier to fix it in the fermenter than in the bottles!
It's common practice to take an initial gravity reading too. This allows you to determine the alcohol content of the beer by looking at the difference between the starting and finishing gravities.