Suppose you have a core switch that connect to several access switches (leaf and spine topology).

If your access switches have each 48 1Gbs ports, you can potentially aggregate 48Gbs of traffic to be passed to the core switch, so you would need a connection between the access switch and each core switches of at least 48Gbs.

Most often, this would be wasteful, because in practice you will never encounter a situation where all ports receive traffic at their maximum rate at the same time.

So we could have a core switch with 10Ggbs connection to the access switches and access switches with 1Gbs ports.

If the access switch has 48 ports and a 10Gbs to its upstream switch, we have an over-subscription of 4.8:1

> When we use it and when not to use?

As you can see it is almost always used when you have several switch layers.

You don't use it:

 - when you have only one switch layer (very small networks)
 - when you have very specific requirements and wants the full bandwidth available on all ports at any time (and enough money to do so)

> How do we calculate these Value?

It can be tricky to choose the correct over-subscription factor. This is why, from its vast experience and analysis of real networks, Cisco make some recommendation, such as the one you quoted.

But the correct values for a given network highly depend on the traffic pattern.
    
> If this is a configurable parameter, what are the commands which use
> to configure?(Cisco or Juniper)

You can see now that it is not something we configure, but it is a design choice.

**Note:**  
The ports speed is not always the limiting factor. Most often the switch hardware is not capable of handling the full bandwidth on all its ports simultaneously; this is indeed a kind of internal over-subscription (once again mostly driven by real usage patterns and costs).