Yes, gravity affects atomics clocks.
The different rates at which time passes in gravitational fields of different strengths was tested in Chou (2010) by the National Institute of Standards and Technology (NIST) by Boulder, Colorado investigators, as reported in the journal Science. The prediction of general relativity is called gravitational time dilation (and per the link has also been confirmed by other observations).
The time dilation effect $T_d$ is approximately as follows for a given gravitational acceleration g at the bottom of the gravity well and a given height, h difference between the two clocks and the speed of light c, per the second link above:
[W]hen g is nearly constant and gh
is much smaller than $c^2$, the linear "weak
field" approximation $T_d=1+\frac{gh}{c^2}$
can also be used.
But, when clocks are in free fall, their relative rates due to gravitational effects are the same as directly measured by the NIST in Boulder, Colorado, and at 14 other locations, as described in a journal article published in Nature Physics, Ashby (June 2018).
Now the question is whether the number of cycles per second of a
cesium atomic clock also slows down at higher gravity or that only the
second is (also?) longer with higher gravity so that there is no
difference?
As another answer by @Kosm notes it is definitionally true that the number of a cesium atomic clock that passes is the definition of the second. A second is defined as 9,192,631,770 cycles of radiation of caesium-133. So, the length of the second as measured by the number of cycles of a cesium-133 atomic clock does not change.
Less trivially, the flow of time is slower in a stronger gravitational field from the perspective of an observer in a weaker gravitational field.
So, it is more accurate to say that the second is "longer" in higher gravity relative to the second in lower gravity, than to say that the number of cycles per second in the eyes of the local observer changes.
But, because the flow of gravity affects the flow of time in the vicinity of the atomic clock, this is an effect on the atomic clock. The number of cycles per second a a cesium atomic clock in the reference frame of each atomic clock, regardless of the local strength of gravity, is the same.
This is not a "mechanical" effect, it is simply a function of the fact that in Special Relativity and also in General Relativity, time passes for different observers at different rates relative to either other, based upon their speed relative to the speed of light and the strength of the gravitational field in which they are located.
While our common intuition is that we live in Euclidian space at which time passes at the same rate for all observers even relative to each other, we instead live in Minkowski space, in which time flows at different rates for different observers.
For further reading, a closely related set of answers discussion this more from the perspective of general relativity theory, can be found at this Physics.SE post.
The follow up question by the person asking the question in the comments:
But hów does gravity bend spacetime? I think GR explains according to
what mathematical law spacetimes get bended but not how this occur,
and that is the question. – Marijn Apr 25 '17 at 15:22
is basically a category error.
This occurs because it is a physical law of Nature, expressed mathematically through the Theory of General Relativity (which, even if it is not exactly correct, is still an extremely close approximation of the truth) and that is how the universe works.
If there is a mechanism that gives rise to a gravitational field (e.g. gravitons which are used to generalize general relativity into quantum gravity; although even quantum gravity assumes Special Relativity as a physical law, rather than providing a mechanism for it), this mechanism has not been observed. There is no evidence nor any widely accepted theoretical explanation that supports any "mechanism" by which time dilation happens other than the existence of a strongly empirically supported physical law of Nature which is observed.