Section 31 first appeared (in real life) in the 1998 DS9 Season Six episode "Inquisition," in which it was established that they had been "part of the original Starfleet Charter." They then appeared in the 1999 DS9 Season Seven episodes "Inter Arma Enim Silent Leges" and "Extreme Measures." "Inquisition" took place in 2374, and "Inter Arma" and "Extreme Measures" took place in 2375.
Their next canonical appearances (again, by the real world) were in four ENT Season Four episodes that aired in 2005 -- the duology "Affliction" and "Divergence," and the duology "Demons" and "Terra Prime." In these episodes, we learn that Section 31 exists within the United Earth Starfleet of the 22nd Century, and justifies its existence and takes its name from Article 14, Section 31 of the United Earth Starfleet Charter, which states that regulations can be bent in times of extraordinary crisis. Lt. Malcolm Reed turns out to have previously worked for Section 31. These episodes were all set in 2155. Reed's involvement with them prior to joining the NX-01 crew implies that Section 31 existed at least as far back as the 2140s.
Section 31's final canonical appearance (so far) was in 2013's feature film Star Trek Into Darkness, set in the alternate universe's 2259. To date, this is their only canonical appearance in the 23rd Century.