How does temperature change after compression in non-adiabatic process? I understand that in an adiabatic compression, we will do it fast enough to not allow any heat to escape the cylinder. But suppose I can't do it fast enough.
What law - or formula - is used to find the final temperature and pressure of the air immediately after compression ceases? And what quantities, apart from initial temperature, initial pressure, initial volume and final volume, must be known. A step-wise explanation, rather than a blunt answer relating the relevant formula/law, would be appreciated.
 A: 
I understand that in an adiabatic compression, we will do it fast
  enough to not allow any heat to escape the cylinder. 

That's one way for the process to be adiabatic, if the piston/cylinder is not thermally insulated.

But suppose I can't do it fast enough.

If you don't do it fast enough, and the piston/cylinder is not thermally insulated, the process won't be adiabatic. But if the piston/cylinder is thermally insulated, there can be no heat transfer regardless of how fast or slow the compression is carried out. 
The difference is in the first case (non thermally insulated) after the compression is completed, heat will eventually transfer from the gas whose temperature increased due to rapid compression to the surroundings and the gas will eventually be in thermal equilibrium (same temperature) with the surroundings.  In the second case the temperature of the gas will reach internal equilibrium at some higher value than the original temperature.

What law - or formula - is used to find the final temperature and
  pressure of the air immediately after compression ceases?

If the air can be considered an ideal gas (which is generally the case except for very high pressures or low temperatures), you can use the following relationship between initial and final equilibrium states based on the equation of state for an ideal gas for any process.
$$\frac{P_{i}V_{i}}{T_{i}}=\frac{P_{f}V_{f}}{T_{f}}$$
In the case of an insulated piston/cylinder, if the process is carried out reversibly (i.e.,very slowly or quasi-statically) so that the gas pressure is always in mechanical equilibrium with the external pressure, you can relate the initial and final states by the equation for a  reversible adiabatic process, or
$$P_{i}v_{i}^{k}=P_{f}v_{f}^{k}$$
where
$$k=\frac{c_P}{c_V}$$
also, from the first law
$$\Delta U=Q-W$$
Since $Q$=0 for an adiabatic process, then for an ideal gas
$$\Delta U=-W=C_{V}(T_{f}-T_{i})$$
and finally, for a reversible adiabatic process
$$W=\frac{(P_{f}V_{f}-P_{i}V_{i})}{(1-k)}$$
Depending on what initial and final properties are known, some combination of the above equations should be sufficient to determine the final pressure and temperature.
Hope this helps.
