Budapest -- history of the name
The name of Budapest as the capital of Hungary goes back to 1872, when the three independent cities of Buda, Pest, and Óbuda (Old Buda) were merged into a single metropolis. Margaret Island which until then had still been part of Pest County was added to the new city as well. Therefore legally the name of Budapest goes back to this decree.
Nevertheless, the name Budapest had occasionally been in use for a couple of decades before 1872, although referring only to the agglomeration of two cities: Buda and Pest. Another name in common use was Pestbuda or the German Pestofen and Ofenpest. These names often occurred in printed books as the place of publication. In books published in the late 19th century, Pest was also commonly written as Pesth.
Budapest -- modern usage
Today, Hungarians still use the names of Buda and Pest when they refer to different parts of the city. For example, one might say, "I need to go over to Buda tonight" or "I live on the Pest side," etc. At the same time, the name Pest is used outside of Budapest to refer to the whole of Budapest. If you are down by the lake Balaton, you would say that you live in Pest, even though technically speaking you live in Buda. Therefore Pest in this context really means Budapest.