Let's look at this from the worst case:
The LD50 for caffeine is around 150-200mg/kg body weight for a healthy adult or 10g1. The caffeine content of a "cup of coffee" (however you define it) varies with beans, roast and preparation method, but according to Wikipedia, (50-)75-100 cups of drip coffee get you in the lethal ballpark. (More caffeine math on this site.) This is an amount of fluid that you can't ingest without other severe complications, but deaths by pure caffeine, e.g. in tablets can happen.
If you don't kill yourself, the next serious outcome is caffeine intoxication, caused by single doses of about half the LD50 or 400-500mg:
The symptoms of caffeine intoxication are comparable to the symptoms of overdoses of other stimulants: they may include restlessness, fidgeting, anxiety, excitement, insomnia, flushing of the face, increased urination, gastrointestinal disturbance, muscle twitching, a rambling flow of thought and speech, irritability, irregular or rapid heart beat, and psychomotor agitation.[95] In cases of much larger overdoses, mania, depression, lapses in judgment, disorientation, disinhibition, delusions, hallucinations, or psychosis may occur, and rhabdomyolysis (breakdown of skeletal muscle tissue) can be provoked.[99][100]
(Source)
Everything else is a question of your metabolism and caffeine tolerance vs. desired and undesirable effects. For example: coffee is a stimulant that counters fatigue and drowsiness - and thus can keep you awake if it's not metabolized when you want to sleep.
There is no general "safety threshold", but if you look at the recommendation of both the American Congress of Obstetricians and Gynecologists (ACOG) and the UK Food Standards Agency for pregnant women, the 200mg caffeine per day deemed safe for them2 should be more than safe for every other healthy adult.
1 Sources vary between 5-30g, but LD50 rates for humans aren't exactly a field of much experimentation.
2 Pregnant women show a decreased caffeine metabolism (up to 15 hours vs. 3-4 hours in non-pregnant women) and there is a large safety margin to protect the unborn child.