The two British drivers took advantage after morning rain made the Istanbul Park circuit slippery, causing Sebastian Vettel to crash. The Formula One champion wasn't hurt.
"The car's been working reasonably well," Button said. "Trying to get the car to ride the bumps well into Turn 12 has been difficult, but we improved it through the session. Turn 12 is really bumpy, it's like they put a motocross jump in there."
Hamilton saw encouraging signs for McLaren after a tough start to the season.
"I was really pleased with my long-run pace," he said. "I think it was probably one of the best practice long runs I've ever had."
Vettel leads Hamilton in the overall standings by 21 points after winning the first two races and finishing second to Hamilton in the third, three weeks ago in China.
Vettel did not start the second practice because Red Bull preferred to wait until Saturday.
"Unfortunately, it did quite a lot of damage, so rather than rush to cobble together a car, we decided we wanted to rebuild [it] carefully," Red Bull team principal Christian Horner said. "He got a little bit high on the exit to Turn 8 onto the curb, [and put] the wheel on the Astroturf that's claimed a few victims today."
Temperatures improved slightly and the track dried out for the afternoon session, when Germany's Nico Rosberg matched his impressive morning with the second quickest time.
Button, the 2009 F1 champion, completed 26 laps and set a best time of 1 minute, 26.456 seconds, while Rosberg clocked 1:26.521 and Hamilton 1:27.033.
It was a day of contrasts for McLaren. A bad morning session saw Hamilton fail to post a time after his clutch stuck as he prepared to join the session late.
Button managed only four laps and was nearly 22 seconds slower than Fernando Alonso, who was fastest in the morning to boost Ferrari's hopes of getting its first podium finish this season.
Alonso could not repeat the performance in the afternoon, when a hydraulic problem forced the two-time F1 champion from Spain back into the pits.
"This track puts a heavy load on the tires, it will be interesting to see what happens in the race," Alonso said. "I think we have made progress, but there are various teams that are quicker than us."
The wet conditions caused problems throughout the morning, with new drivers Paul Di Resta and Pastor Maldonado struggling to keep control. Maldonado came off the track and the nose of his Williams bumped into the safety barrier. The Venezuelan was unhurt but the car needed to be towed.
Vettel completed only four laps and was 17th fastest when he went way out on a right turn and his car slid into the crash barrier on the left side. The German driver was undone on Turn 8 -- the longest in F1 at 2,000 feet.
"There was some water on the exit," Vettel said on race radio. "There was nothing I could do."