If I have a piston cylinder system and assuming that the position is massless and the pressure is the atmospheric pressure outside the cylinder . Will I consider the pressure inside the cylinder also the atmospheric pressure or not? Is this assumption valid?
If the piston is not moving it means that the forces from inside and outside are balanced.
Typically the surface of pistons are the same inside and outside, which then implies that also the pressures (=force per area) are the same.
The pressure inside the cylinder may not be uniform if the gas in the cylinder is deforming rapidly (i.e., irreversibly). But, from Newton's 2nd law of motion, the force per unit area of the gas on the inside face of the massless piston must exactly match the atmospheric pressure on the outside face of the piston. And, it is the force per unit area on the inside face of the piston times the change in volume of the gas that determines the amount of work that the gas does.
As far as the equilibrium condition is concerned, the mass of the piston is not an issue.
In order to justify the claim of equal internal and external pressure, if the piston is not moving, there are two requirements: the first is that it is possible to speak about pressure inside the cylinder, i.e. the system inside the cylinder should be at equilibrium. The second, is that no other forces should act on the piston. In a real experiment, friction force between piston and cylinder wall could be significant. In such a case, the piston would remain at rest, even in the presence of a difference between internal and external pressure, until the difference of pressure multiplied by the piston surface area exceeds the static friction force between piston and cylinder.