There is no written record of who built Borobudur or why it was built. It was likely founded as a religious site in the 8th century at the peak of the Sailendra dynasty in central Java. The construction is thought to have taken a period of 75 years and completed in about 825 AD.
The confusion between Hindu and Buddhist dynasties and rulers in Java during this is a little baffling for visitors. Many Hindu and Buddhist monuments were constructed in the central Java region at this time. For example Borobudur and the nearby Hindu Prambanan temple compound were more or less contemporaneous. This, together with many records of royal marriages between Hindu and Buddhist nobles, has led academics to believe that there was little serious conflict concerning religion in central Java at this time. Such an assumption certainly helps the visitor understand the confusing archaeology of the region.
Borobudur lay abandoned and hidden for centuries under layers of volcanic ash and thick jungle growth. Nobody knows for sure why it was abandoned although the popular theory is that the local population just became disinterested when there were mass conversions to Islam in the 15th century. It was never forgotten entirely though with folklore ensuring that stories of the great monument lived on.
Source: http://wikitravel.org/en/Borobudur