I don't understand how does of mass an object for example say earth causes distortion in space and time. I am just new to this field so it is difficult imagine this phenomenon.
We observe phenomena consistent with mass distorting spacetime, and therefore we assume it does. Empirical observation is the ultimate master of all physics.
Some of the evidence: https://en.wikipedia.org/wiki/Tests_of_general_relativity
The "How does the mass of an object affect space and time", part of your question could mean one of two things. I will assume you mean "What is the underlying mechanism (causation) that links mass to curvature?" (The sentence could also mean "What effect does mass have?").
In terms of "mechanism" I would like to first take a step back and think about "What is stuff made of?". The ancient Greeks believed that all stuff was fundamentally built from "atoms", the smallest building blocks. Atoms, by this definition, were not made of anything smaller and thus "what are atoms made of" was a nonsense question. (This issue got confused later because we thought we discovered these atoms, called the things "atoms", then discovered smaller building blocks.)
In any case we now have fundamental particles filling this role, as objects that are not made of anything smaller that we know of.
Now apply the same logic to a process. A process is made up of smaller processes in the same way an object is made of smaller particles. (The big process "the gun killed the bird" is made of many parts like "the explosive in the gun was ignited" or "the bullet travelled through the air".)
So the disapoting answer is: that as far as anyone is aware the process "mass curves spacetime" is a fundamental process. And just like we don't know if electrons are made of anything smaller or are just fundamental, we don't know if this process is made of sub-steps or is fundamental.