The compound interest formula is:

where A is the final amount, P is the initial investement, r is the interest rate in decimal form and n is the number of times the interest is compounded in any given time t.
In this case P is 512, r=.05, n=6 (in one hour the interest is compounded six times) and t is 1, then we have:

Therefore the final amount is $538.14 and the interest earned is $26.14