It is hard to say with certainty when that prosthetic leg was made, but the odds are that it was well before the 19th Century. It’s the sort of peg-leg that is depicted in a Robert Louis Stevens novel about pirates and buried treasure, which would place it in the 15th to 18th Century. By the 19th Century, Prosthetics were becoming fairly sophisticated, as is evidenced by the three photos of WWI prosthetics below. The last two photos are examples of relatively sophisticated prosthetics that were being made by Ambrose Peré in Paris in the 16th Century, but they are the exception rather than the rule and only the very wealthy could afford them. The primitive type you posted are representative of the vast majority of prosthetic legs that were made by craftsmen such as ship's carpenters, cabinet makers, and smiths from before the Romans. Dwight
Here are two examples of fairly sophisticated prosthetics from the 16th Century, produced in France probably by Ambrose Paré.