The theory Albert Einstein put forward about special relativity mentions a possibility for time dilation, in which he states gravity has a considerable effect on time.

And in high school physics we learnt that the time period of a simple pendulum is given by, 

$$T = 2π\sqrt{\frac{l}{g}}$$

Where $l$, $g$ have their usual meanings.

Well, this describes how the period of oscillation experienced by a simple pendulum depends on the gravitational acceleration present.

My question is whether Einstein proposed his view on time dilation based on a similar phenomenon.

It is worth noticing here that as g tends to zero, time period tends to infinity. This doesn't mean that the actual time is lengthening, but the tangential force on the pendulum decreases, which will ultimately cause the pendulum to stop. But the time goes on, as a dead battery on my wrist watch doesn't imply that the actual time has stopped (not even relative to me)!