I agree with Sam: "the longest day" is just a polite way of saying "the days are shrinking again, get ready for winter!" Gloom! :-)
The date (11 June) feels wrong for the summer solstice, but Sam is right.
In England, the Gregorian calendar was only adopted in 1752. France and Spain already used it since 1582, the year when Pope Gregor XIII had made it official.
In Pepys's time, England still used the older Julian calendar, which in 1663 was 10 days behind, so the 11 June 1663 in Pepys's London was the 21 June 1663 in Moliere's Paris or Bernini's Rome. The sun apparently didn't care much either way.
When the switch in England finally happened in 1752, the gap between the two conventions had grown to 11 days. And thus in Samuel Johnson's England in 1752, you went to bed on the evening of 2 September and woke up on the morning of 14 September. The dates in between got swallowed up.