To the Editor:

After having seen the movie ''Batman,'' a friend and I wondered: when and by whom was New York City first called Gotham? And what are the implications of the name Gotham?

Gotham, some may know, was a village of southern Nottinghamshire in England, whose inhabitants are reputed by legend to have feigned stupidity to prevent King John from establishing a residence there.

Washington Irving seems the first to have called our fair city Gotham, in his Feb. 13, 1807, letter in the ''Salmagundi Papers'': ''One of the most tickling, dear, mischievous pleasures of this life is to laugh in one's sleeve - to sit snug in a corner unnoticed and unknown and hear the wise men of Gotham, who are profound judges (of horseflesh) pronounce from the style of our work, who are the authors. This listening incognito and receiving a hearty praising over another man's back is a situation so celestially whimsical that we have done little else than laugh in our sleeves ever since our first number was publisht.''

Irving refers to New York City as Gotham throughout ''Salmagundi'': ''though pedestrian merit may strive in vain to become fashionable in Gotham''; ''Oh! Gotham, Gotham! most enlightened of cities! - how does my heart swell with delight when I be-hold your sapient inhabitants lavishing their attention with such wonderful discernment!''; ''the good citizens of the wonder loving city of Gotham''; ''fully aware of the profound sa-gacity of the publick of Gotham.'' Good fun! ELIZABETH RYAN New York, Aug. 12, 1989