Every stack in the game works differently, but there are some aspects in common.
Stacks are gained and accumulate. Each stacks lasts for a while, and then you lose it. You usually get a bonus for each stack. Most stacks will show up on your screen above your experience bar, as you can see in the Nisha screenshot in Chimp's answer. Getting more specific than that requires looking at the specific skill descriptions.
Nisha Example
Feral Chimp has provided a good example of this with Nisha's Order stacks.
There, you can see that the way in which you gain the stacks is spelled out in the skill description:
Every time you take 15% of your maximum health in damage, you gain a stack of Order.
The skill description also says how you lose the stacks (not included in Chimp's answer):
Order stacks are quickly lost when outside combat.
And also what benefit you gain from the stacks:
Based on your number of Order stacks, you have a chance to instantly heal double the damage taken.
and
Heal Chance +1.2% per Order stack.
As well as the maximum number you can have:
Maximum Stacks: 10.
Frag Stacks
All the information you need to answer your question is in the skill description you've provided.
How you gain the stacks:
Upon selecting Subroutine you gain 100 Frag Stacks which decrease over time.
So you get 100 every time a subroutine is selected. This is a bit odd, as most stacks require you to earn them by doing something, such as Nisha's Order stacks which require you to be damaged, or Wilhelm's Rolling Thunder stacks which increase the longer Wolf is active.
How you lose the stacks:
Upon selecting Subroutine you gain 100 Frag Stacks which decrease over time.
These stacks simply decrease over time from 100 to 0. It's basically a countdown. Although other skills in Claptrap's tree allow you to modify the rate at which it counts down, at first you have no control over it.
What the stacks do:
You randomly pick a Subroutine focused on Health or Shields, which grants increased Capacity and Regeneration for the chosen attribute.
These stacks are also unusual in that there is no per-stack bonus. Most stacks give you something per stack, like Nisha's Order stacks which give you a chance to heal per stack, or Wilhelm's Rolling Thunder stacks which give extra Wolf damage per stack. Instead, as long as you have Frag stacks you'll get specific preset bonuses to the randomly chosen attribute: health or shields. The bonuses are also listed in the skill: "Capacity +35% Regeneration 2.5% of Max Attribute / sec. Gun Damage -15%". So if Shields was chosen as your subroutine, you get +35% shield capacity, -15% gun damage, and regenerate 2.5% of your shields per second.
How many you can have:
Upon selecting Subroutine you gain 100 Frag Stacks which decrease over time.
I don't think there's actually a cap on frag stacks, but it might be 100. I'm not really using this tree with my claptrap, except for the one skill you're asking about. Eventually there are skills which let you add to your frag stack total, and it's possible these could push you over 100 stacks. At first though, you can't affect the total, and just get 100 to begin with.
You can see your current frag stack count above your experience bar.
Best Answer
There's a code panel on the wall above and to the right of the door that you're trying to open. You need to shoot the arrows on the left and right of the numbers to change them to what you read on the authenticator, then use the control panel to open the door. Everything in the room with the authenticator is just a red herring at this point, except for the values on the authenticator.
Obviously this is easier to do with 2 or more players, as one can stand at the panel in Lab 19 while the other reads the numbers from the authenticator, but there is more than enough time to do it solo, if you read the value as soon as it changes and book it back to Lab 19.
Credit where credit is due