Works when placed between lava and ice. Each thermopile can have 6 of them placed adjacent itself, for a total of 3 lava/ice pairs. though since you need a wire to take power out, each is typically limited to 2 pairs. Each pair will generate 0.25A of output. While you could replace the ice with water, it'll generate significantly less at only 0.07A.
Using a Voltmeter, it is possible to read the power output of a Thermopile. Right clicking the thermopile will show two numbers, one with V and one with A, but do not read it if it's connected to a output source like wires or batteries boxes because thanks to a bug, the A value WILL show as double the amount on the wires and thermopile. V is the current stored charge, while A is output. One Thermopile, even with 2 lava/ice pairs, takes a very long time to charge a Battery Box as it'll only output at 0.50A. Compare to the Blulectric solar panel, which outputs at 1.00A each panel.
Bear in mind that each Blue Alloy Wire between the Thermopile and the Battery Box will reduce the output by ~0.01A. Also, take note that the old examples/pics below are not the optimal way to set it up, as using only 1 lava with 4 ice around a thermopile will only output .25A, since there is only ONE pair of lava/ice.