I do not have much experience in Statistics. However, I read this rule on a page and followed it up on Wikipedia: https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule
I wanted to know whether I can calculate how many times the standard deviation, do I need to travel in both directions from mean, so that I can cover any given percentage of data, with some accuracy?
Thank you for reading so far.
Short answer
If you have a calculator, the invNorm function on the TI-84 or similar commands on other calculators will take a probability $p$ as input and output the upper bound of the interval (starting from the left tail) by the number of standard deviations away it is from the mean (a negative output is left of the mean and a positive output is right of the mean). The probability that the variable in question has value within the given interval is equal to $p$.
Long answer
I wasn't sure what you know and don't know, so I will start with some prerequisite information.
As you may know, the probability distribution function (or pdf) is the characteristic function of a probability distribution. For the normal distribution, graphing the pdf reveals the trademark "bell-curve".
The pdf for the normal distribution is below:
$$\frac{1}{\sqrt{2\sigma^2\pi}}e^\frac{-(x-\mu)^2}{2\sigma^2}$$
To calculate the proportion of the data (ie: the probability) within an arbitrary interval of the bell-curve, we integrate the pdf with respect to x along that interval. For example, if I wanted to calculate the probability that $X$ has a value in the interval $[1,3]$ given a mean $\mu=0$ and standard deviation $\sigma=1$, I would evaluate the following integral:
$$\int_1^3{\frac{1}{\sqrt{2\pi}}e^\frac{- x^2}{2}}dx \approx 0.16$$
In general, the integral of a pdf is known as the cumulative distribution function (or cdf).
So the probability that $X$ has a value between 1 and 3 is 0.16. It is important to note that the bounds of the integral directly correspond to the number of standard deviations away the interval is from the mean. Since the standard deviation is 1, the upper bound of the integral is $3\sigma + \mu = 3(1)+0 = 3$ and the lower bound is $1\sigma + \mu = 1(1)+0 = 1$.
What you are trying to do is the reverse of what I showed above. Given a probability $p$, what interval $[a,b]$ does the integral of the pdf evaluate to $p$? To make things simpler for now, let's set the lower bound of the interval $a$ to $-\infty$ so that we start at the left tail.
To calculate $b$, we use the inverse of the cdf called the quantile function. The quantile function for the normal distribution with mean $\mu=0$ and standard deviation $\sigma=1$ is known as the probit function:
$$ \DeclareMathOperator\erf{erf} \Phi^{-1}(p)= \sqrt{2}\erf^{-1}(2p-1) $$
Note: By standardizing data into z-scores:
$$z = \frac{x-\mu}{\sigma}$$
We can use the probit function for any normal distribution.
Finally, inputting an arbitrary probability $p$ into the probit function will give you the z-score of $b$ (ie: the number of standard deviations away $b$ is from the mean) so that the probability of $X$ having a value in the interval $[-\infty,b]$ is equal to $p$.
Note: the probit function is a rather complicated (not elementary) function. As such, it is approximated by numerical integration, or by using the aforementioned invNorm function to approximate it for you.
Now to answer your question:
We now know how to calculate the interval $[-\infty, b]$ for any probability $p$ that $X$ has a value within that interval.
With the information we now have, we can find a value $c$ so that travelling $c$ standard deviations above and below the mean results in an interval $[-c,c]$ that covers an arbitrary proportion (or probability) $p$ of the data.
Specify a probability $p$
Calculate $1-p$ This number is very important. It represents the tail-end probability. Call it $q$
Divide $q$ by 2. We only want to deal with half of the distribution (the left half). Call this result $r$
Voila! You have now calculated the number of standard deviations necessary to cover $p$ percent of the data.
I hope this helps!