I have been wondering that what will happen to a particle performing SHM and starts losing it's mass. Will it be in SHM again or something else.
I am just grade 12 student.
Gandalf's answer curiously ignores the fact that mass is being lost in their analysis of the pendulum and hence is entirely wrong on that part. For the leaky harmonic oscillator (spring or pendulum), the mass loss absolutely impacts the period of the oscillator.
If you have a pendulum bob that is full of a liquid that is leaking out, then what actually happens is that the center of mass of the pendulum is changing over time, moving further out, as shown below.
Image made using Google Draw. The blue is the liquid coming out of the bob, in black with the center of mass marked.
We know that for a simple pendulum (and assuming the small angle approximation), the period depends on the distance from the pivot to the center of mass as, $$ T\simeq2\pi\sqrt{r/g}\tag{1} $$ where $g$ is the gravitational constant and $r=\ell+r_\text{com}$ is the total length of the rod and distance to the center of mass, as diagrammed above. Since $r$ increases with time, then the period will also increase with time.
But this happens only up to a point! Eventually, the weight of the liquid leaking out is small compared to the bob's weight, so the center of mass starts returning to original center of mass and, hence, the period returns to the original value of Eq (1).
For the simple spring, the period follows, $$ T\sim\sqrt{m/k} $$ where $k$ is the spring constant. Since the mass is changing (decreasing), the period will also change (decrease).
For the more advanced readers, the change to the dynamics is far more clear when considering the Lagrangian formulation. In this case, the kinetic energy would take the form $T\equiv f\left(m\left(t\right),\,\dot{x},\,t\right)$. Hence, the Euler-Lagrange equations would give us something akin to, $$ \frac{\mathrm d}{\mathrm dt}\left(\frac{\partial T}{\partial\dot x}\right)=F_\text{mass loss}+F_\text{accel} $$ where $F_\text{mass loss}$ contains that $\mathrm dm/\mathrm dt$ term and $F_\text{accel}$ the typical second-derivative of position term(s).
See also these similar questions:
The answer depends on the nature of the force that is causing the simple harmonic motion (the "restoring force").
In the case of a simple pendulum, the restoring force is the weight of the object. This is proportional to the mass of the object. So if the mass of the object changes, the restoring force changes by the same proportion, and the period of the pendulum does not change (if we assume a point mass for simplicity).
However, in the case of an object oscillating on a spring, the restoring force is determined by the spring constant $k$, which is independent of the mass of the object. If the mass of the object changes then the restoring force does not change by the same proportion, so the period of oscillation does change as the mass of the object changes. Once you have a changing period then the motion is no longer simple harmonic motion.