From social security pamphlet:https://www.ssa.gov/pubs/EN-05-10069.pdf
"Sometimes people who retire in midyear
already have earned more than the
annual earnings limit. That’s why there
is a special rule that applies to earnings
for one year, usually the first year of
retirement. Under this rule, you can
get a full Social Security check for any
whole month you’re retired, regardless of
your yearly earnings.
In 2016, a person younger than full
retirement age for the entire year is
considered retired if monthly earnings
are $1,310 or less.
For example, John Smith retires at
age 62 on October 30, 2016. He will
earn $45,000 through October. He
takes a part-time job beginning in
November earning $500 per month.
Although his earnings for the year
substantially exceed the 2016 annual
limit ($15,720), he will receive a Social
Security payment for November and
December. This is because his earnings
in those months are $1,310 or less, the
monthly limit for people younger than
full retirement age. If Mr. Smith earns
more than $1,310 in either November or
December, he won’t receive a benefit for
that month. Beginning in 2017, only the
annual limit will apply to him.
Note that benefits for November are paid in December