He was born in Sloatsburg, New York, of Dutch ancestry, and orphaned at an early age, his father having been killed by a British soldier two months before he was born, and his mother dying a few years later. He was brought up by his maternal grandparents.
Appointed midshipman in the Navy in 1800, he became sailing master of the frigate USS United States under Commodore Stephen Decatur by the War of 1812, and was promoted to lieutenant for conspicuous gallantry in the capture of the frigate HMS Macedonian.
Sloat then served on the USS Grampus, USS Franklin, USS Washington, and USS St. Louis. In 1844 he was appointed to command the Pacific Squadron, and in 1845, as tensions with Mexico grew, he was instructed to land in Alta California and claim it for the United States if war broke out. Receiving a report of fighting on the Texas border while off Mazatlán, he raced north (the British were reportedly interested in California too), engaged in a skirmish called the Battle of Monterey, raised the flag over the Customs House at Monterey on July 7, 1846, and issued a proclamation announcing that California was now part of the United States.
Later his health forced him to take commands ashore, where he helped plan the Mare Island Navy Yard. After his retirement in 1866 he was promoted to Rear Admiral. He died in New Brighton, New York, and was buried in Brooklyn's Green-Wood Cemetery.
The USS Sloat (DE-245) and the USS Sloat (DD-316) were named in his honor. A major street, Sloat Boulevard, and Commodore Sloat elementary school, both in San Francisco, are named after him. Local streets in Monterey, California and the Carthay Circle neighborhood of Los Angeles also bear his name. There is a large monument erected in his honor on the Presidio of Monterey US Army post. An elementary school in Sacramento is also named for him.