Think of it as you would any other career progression. The Navy promotes those who do well from among those who stay in. A lot of officers finish their obligatory service and get out. Some by their own choice, others by the Navy's choice. From those who continue after their initial obligation, most will serve as Department Heads (mostly with the rank of Lieutenant of Lt. Commander), rotating through Navigation, Weapons and Deck, and Engineering. Essentially, all of those will be qualified as Engineer Officer by that time, but the Engineering Department Head (the Engineer) is a senior position (normally a senior Lieutenant or LCDR). Following the Engineer tour, is a term as Executive Officer (LCDR or Commander) and then Commanding Officer (Commander or Captain). Interspersed throughout those assignments are some shore duty billets and opportunities for further education -- graduate school is a possibility. On a boomer the Weapons Officer is considered a little higher up the food chain than on a fast attack. By the time you get to command a boat, you will probably have served on both boomers and fast boats. You will most likely not be in command of any of your first three ships (certainly not the first two), and maybe not your fourth.
From the time a new officer emerges from Sub School until getting to command a sub takes about fourteen to sixteen years minimum. Assuming that you stay the course and hold command until relieved (that's a polite way of saying that they didn't fire you) you would be eligible to retire at or near the end of your first command tour, but most stay longer.
There is only ONE position offered to a submarine officer upon completion of NUPOC. That is to become the most junior Ensign onboard a sub. The junior Ensign will basically study his butt off until he (or she) is qualified. While studying, you will be given increasing levels of responsibility as a Division Officer (they'll start you off small and work you up) A common starting point is as Chem/Radcon Officer, since this is a Division Officer billet that is normally assigned to the Main Propulsion Assistant, who is also a DivO. It's like having training wheels. From there, you'll bounce around from Torpedo Div. to perhaps Sonar or Electrical Officer, Communicator, Damage Control Assistant, Main Propulsion Assistant, Reactor Controls Assistant or any other that I forgot to name. You will hold at least two (probably three or more) of those positions over your JO tour, with some being higher up the ladder than others. There are also collateral duties, such as Diving Officer (in charge of the divers) or First Lieutenant (normally a CPO on a sub unless they have too many JO's and nowhere to put them).
None of the above will be your choice. You'll go where they put you, and stay there until you prove you are ready for something bigger. Meanwhile, you will have to qualify as EOOW, DOOW, Surface OOD, and finally OOD before you get your Dolphins.