The Knights templar were an order of Warrior Monks (Along with the Knights Hospitiler) who were formed to protect pilgrims going to Jerusalem.
They became very rich anf Phillip IV of France had it's leaders arrested charged with various things and executed seizing their property.
They persisted a little elsewhere but died out.
They are a great favorite of conspiracy theorists though who claim they survived and are secretly running the world or some such nonsense
If anybody is talking about the templars after the early 14th century they're probably cranks
http://en.wikipedia.org/wiki/Knights_Templar
Free masonry arose about 400 years later - all the guff about the Temple of Solomon and the medieval temples is just fantasy
The first grand lodge was formed in 1717
It basically was a great meeting place for the aristocracy (who had influence) to meet with the rising merchant classes (who had money)
Outside of Freemasonry crossing such class boundries was frowned up
http://en.wikipedia.org/wiki/Free_masons#History
Umberto Eco's book Fouquet's Pendulum is a great story of conspiracy theories with Masons, the Illuminati, the Knights Templar and Jewish Cabala. It can be a challenging read but is one of my favorite books