Does auto pilot take into consideration the altitude, speed, and the difference in heading change, to calculate the degree of bank?
If your talking about standard rate turns, those are not really practical in large commuter aircraft. As true airspeed increases the maximum turn rate decreases when the bank angle is limited to a comfortable level of less than 30 degrees of bank. So please make this question more specific, which airplane category are you talking about?

Usually the autopilot uses the difference between the target heading and the current heading to generate a bank angle target, often just proportional by a linear factor but limited to, e.g. 25 degrees of bank or the minimum of a 30 degree bank turn and a standard rate turn bank angle or even manually selected like in the Boeing aircraft.
The autopilot then calculates the difference between the target bank angle and the actual bank angle and generates a roll rate target. Based on the roll rate target and current roll rate the autopilot computes a roll acceleration target and finally an aileron deflection target, which could, for example, just be a factor times the roll rate deviation.

The computation from the deviation of any of these parameters to the next lower level control loop target can consider the true airspeed and altitude, yes. But this can't be said for all types of autopilots that ever existed and is too broad of a question.

For certification of an autopilot system it has to be demonstrated that the autopilot remains within a safe enveloped, as specified in the requirements. This could limit the roll acceleration, roll rate, maximum bank angle or demand a response within a certain time frame or a maximum deviation for any of these values, transient allowed overshoots, etc. Since the autopilot has to work throughout the flight envelope the parameters used in the computation of the bank angle, roll rate, roll acceleration, aileron deflection, etc. may require a look-up table for each airspeed and altitude to ensure a stable and safe operation.
This can differ between aircraft types, e.g. a large passenger aircraft should fly less aggressive roll maneuvers because the people sitting on the outside far away from the center are being subjected to major g-forces as the aircraft rolls, which is uncomfortable and potentially hazardous.