The phrase three, or two, sheets in the wind means drunk.
Here, sheet is a nautical term denoting a rope attached to the lower corner of a sail for controlling the position of the sail relative to the wind: a drunken person staggering about is likened to a ship careering in all directions because the sheets are hanging freely.
Curiously, however, the earliest instances of the phrase that I have found do not appear in nautical contexts.
The earliest is from a story titled How Lorenzo raised the Devil, published in the Buffalo Gazette (Village of Buffalo, New York) of Tuesday 19th August 1817 (Lorenzo Dow (1777-1834) was an itinerant American evangelist):
A few years since, whilst the famous Lorenzo Dow was travelling through a certain state, he came to a solitary house in the woods, and asked for lodging during the night. The woman of the house reluctantly consented; (her husband being absent and not expected home that night.) Lorenzo got his supper, attended family worship and went to bed in a room adjoining the one where the woman was, and separated from it by a rough partition with large cracks between the boards. Lorenzo could not get to sleep, and therefore lay in a wakeful posture for some time. About midnight he heard a gentle tap at the door which the woman opened to a strudy [sic] looking fellow, who it seemed was the lady’s paramour, whispered to him that Lorenzo was in the next room, and he must speak very low for fear of awaking him. The lovers sat up a while conversing together and then retired to bed. This probably was not surprising to Lorenzo, because he came from a quarter where bundling is in fashion. In the course of an hour the husband unexpectedly began to thunder at the door: The lovers were put into terrible consternation; but the female mind is wonderful for expedients. The paramour was stowed into a large barrel and some cotton lucks thrown over him. The woman opened the door and received her husband with as much tenderness as surprise. He was about three sheets in the wind, that is to say a little intoxicated, and began to talk loud and swear. She hushed him by informing him that a minister the famous Lorenzo Dow, was asleep in the next room. The husband upon hearing this replied that Lorenzo should get up and sup with him, the woman’s entreaties, and Lorenzo’s excuses were in vain, a drunken man is a most unreasonable being. Lorenzo had to get up. Well (said the husband) I understand you can raise the Devil, I wish you would bring him up now, I wish very much to see him. Lorenzo observed he made no such pretensions. The drunkard was importunate and would have the devil raised at any rate. Lorenzo told him he would be sadly terrified at the sight.—No said the husband knocking his fists together, I defy him: well (said Lorenzo) since you would have him raised, I request you would open the door so that he may escape, otherwise he might carry off a side of the house. The door was opened and the husband prepared for the attack. When Lorenzo set the cotton on fire in the barrel, out come the Devil amidst the flames and made rapid retreat through the door. The husband reported the story about in the neigborhood [sic] and upon its being questioned, he went before a magistrate and made oath to it. It gained such evidence that Lorenzo was compelled to explain the mystery by clapping a pair of horns on the head of the swaggering fool.
The earliest instance of two sheets in the wind that I have found is from the following paragraph in The Bristol Mercury, and Monmouthshire, South Wales and West of England Advertiser (Bristol, England) of Monday 2nd June 1823:
A few days ago, a miller and a butcher, residents of Neath, being “two sheets in the wind,” the former offered to sell his horse, cart, and harness to the latter at three halfpence per lb. which being readily agreed to, the necessary process of weighing commenced, and the result was, that the seller realized, by this means of disposing of his “live and dead stock,” 48s. more than they were previously vallued [sic] at.
In the following, the number used in each occurrence of the phrase corresponds to the number of glasses of grog that the person has had—on Friday 16th January 1824, The Hull Advertiser, and Exchange Gazette (Hull, Yorkshire) reported on the trial of Elizabeth Brown and Eliza Thirsk, “charged with stealing a watch and its appendages from the person of Mr. James Reeves”:
James Reeves (a purser in the Navy) […] was two sheets in the wind, that is, he had had two glasses of grog before he met the girls, but was perfectly collected and steady. They had two glasses of grog each at Farrow’s [public house];—then he had four sheets in the wind.
Less specifically, the number used in the phrase, when in contrast to a different number, indicates a relative level of drunkenness; for example, on Saturday 18th March 1848, The Norfolk Chronicle and Norwich Gazette (Norwich, Norfolk) reported that during a trial the plaintiff declared:
I was not quite sober when I left the house. I was three sheets in the wind when I left the house. When quite drunk I am about four sheets in the wind.
Therefore,one sheet in the wind is used to indicate the lowest level of intoxication, as is clear from the following passage from the declaration that Charles Laing, able seaman, made during the investigation into the abandonment of the British ship Calumet, as reported in The Daily Post (Liverpool, Lancashire) of Thursday 31st December 1868:
I was not quite sober at the time, but I was not drunk. I had “one sheet in the wind.”
Based on the misspelling of choir, the following paragraph from the New York Daily Tribune (New York, N.Y.) of Friday 19th April 1844 punningly associates sheet as used in the phrase denoting drunkenness to sheet in the sense of a piece of paper (quire denotes a set of twenty-four sheets of paper):
The Editor of the Newark Post, speaking of a public meeting, says that “the quire sang several National airs.” In answer to this, the Editor of the Boston Bee thinks that “the quire must have been about twenty-four sheets in the wind.”