He is the first sitting US president to visit since the 1959 revolution, which heralded decades of hostility between the two countries.
Mr Obama said change would happen in Cuba and that Cuban President Raul Castro understood that.
The two leaders met to talk about trade and held a joint news conference.
Mr Castro denied that there are political prisoners in Cuba, telling journalists to "give him a list" and then they would be released "tonight".