Paul McCartney wrote the song. He gave it to Peter (of Peter and Gordon) Asher as Jane Asher was Macca's girlfriend at the time.
Yeah - well they had about a dozen albums worth of material for every one they released. All I can say is - as a reasonably competent amateur guitarist myself - that the song is quite well-crafted for an untrained 16 year-old. It's of its time, and today sounds simple and a bit cheesy, but the chord structure is way more sophisticated than most of the simple 12-bar blues that self-taught musicians were turning out at the time.
Oh aye, I don't think enough people realise just how far advanced and different The Beatles were in that respect, especially blending their wide range of influences (particularly McCartney's) with their own improvisations. Think McCartney wrote When I'm Sixty Four in his mid-teens too. I always think the best of McCartney is on Revolver, with six widely different Macca songs, with chord and key changes that your average band in those days were barely thinking about. In fact, I listened to Rubber Soul and Revolver on my treadmill last night (long run). Timeless.
Brian Wilson was driving his car when Sgt Pepper's came on the radio. He pulled over and cried saying "They've beaten me to it"
McCartney said Pet Sounds inspired Pepper. It was a friendly arms race. I still think Revolver is the best though.