What are the chances of a spy stealing your cities' information?

Solution 1:

As already mentioned, tech stealing has a 100% success rate regardless of detection, unless the spy dies from the presence of a counterspy in it. The chance of the latter is ~33/37/42% for levels 1/2/3 of the counterspy.

As for how long it takes for a spy to steal a tech - the raw science output of the city at the start of the spy's mission is stored and accumulated each turn. Once it accumulates more than 1.25x the cost of the highest tech the target civilization can research (again, determined at the start of the spy's mission), you trigger a steal.

The raw science output is modified by the presence of anti-spy buildings and the level of the spy (0/25/50% bonus for levels 1/2/3).

Source:
Source code from Steam -> Tools -> Sid Meir's Civilization 5 SDK:
..\CvGameCoreSource\CvGameCoreDLL_Expansion1\CvEspionageClasses.cpp
Functions CvPlayerEspionage::ProcessSpy, CvPlayerEspionage::CalcPerTurn, CvPlayerEspionage::CalcRequired

GlobalDefines.xml from the installation directory

Solution 2:

You can see the exact potential value by mousing over the stars.

Potential is not about probability. Spies steal technologies more quickly (fewer turns) from a city with high potential.

If you have a spy defending your city, your spy has a chance of killing the enemy spy, but otherwise spies always successfully steal a technology.