It appears to be a 'Pattern 1801' British sea service pistol, as defined by De Witt Bailey (Small Arms of the British Forces in America 1664-1815). The Pattern 1801 was similar to the previous sea service pistols dating back to the early 18th century - hence it has an early shape and look to it - except for the India Pattern 'flat' lock with stamped markings and more border decoration than earlier models. This is the most common of the sea service pistols as it was the main type in use during the Napoleonic Wars and the War of 1812.
This appears to be a pretty good example and the issue with the metal noted above is partly caused by reflection in the photographs, I suspect. The brass does not look overly scrubbed and nor does the steel, as shown by the crisp crown and tower markings on the lock and the clear proof and breech marks on the barrel. This does not appear to be as badly scrubbed as many I've seen.
The belt hook and ramrod look as if they might be original, which is a plus - quite often they are replaced. There are some very high quality kit reproductions of this pistol available, so parts are easily obtained (and some of the well-made 'antiqued' replicas are very convincing indeed!)
The number on the butt is probably a ship's rack number, or that of a naval shore depot or base. Often they have the number stamped on the trigger guard and the ramrod pipe as well.
The 1801 Sea Service pistol has great historical resonance - this was the pistol used in all of those famous naval engagements of the Napoleonic Wars period, including Trafalgar and the famous frigate actions. You can see it being used in the marvellous Peter Weir film of Patrick O Brian's novel Master and Commander, probably the best film ever made showing naval action of that period.