They have recorded around 301 songs, released about 217, and as far as how many they have written, I don't think we'll ever know that. They all wrote songs, some together and some alone and the sheer number of songs is probably too many to count because they themselves never even released them to the public.
The Beatles have recorded or written about 305 songs during their music career. This includes compilation albums, singles, studio albums as well as EP tracks. Some of their best songs include Let it be, Happiness is a warn gun, A day in the life, among others.