Imagine you don't know how to swim. Someone throws you in the deep end of the swimming pool. What are you going to do? You're going to either sink to the bottom and drown or learn how to swim damn fast. The default, of course, is sink and drown, unless you do your utmost to swim and survive instead.
The same principle applies in everyday life. When a situation becomes overwhelming, what are you going to do? You're going to "sink or swim". "Sink or swim" is used as a short-hand phrase to refer to a desperate situation in which one must succeed or else they will fail terribly, with no alternatives. The phrase also infers that sinking or swimming relies on one's own skills and abilities in the situation. The situation can be anything, as long as it's high pressure and desperate.
Procrastinated all semester and now that project worth 70% of your mark is due in less that a week? Time to get studying & writing, it's sink or swim time!
Told the boss you could do something that you knew was beyond your reach, and now you're likely to get fired if you don't do that thing? Learn fast, you're going to sink or swim.
Had a lot of stuff packed into your calendar and short of time already, but couldn't say no to your dad asking you fit in an errand for him? Better get organised, time waits for noone. Sink or swim!
Similar phrases are "trial by fire" and "do or die".