How Long can Chicken Marinate Safely?

How long chicken can marinate safely is 24 hours just as long the chicken has been kept at the same temperature.Its not healthy to change the temp on the chicken especially if its from cold to warm,this is how the bacteria begins.