The Rambam writes in Hilchos Teshuvah 5:2 :
אל יעבור במחשבתך דבר זה שאומרים טיפשי האומות ורוב גולמי בני ישראל, שהקדוש ברוך הוא גוזר על האדם מתחילת ברייתו להיות צדיק או רשע. אין הדבר כן, אלא כל אדם ואדם ראוי להיות צדיק כמשה רבנו או רשע כירובעם, או חכם או סכל, או רחמן או אכזרי, או כיליי או שוע; וכן שאר כל הדעות.
Chabad translation :
A person should not entertain the thesis held by the fools among the gentiles and the majority of the undeveloped among Israel that, at the time of a man's creation, The Holy One, blessed be He, decrees whether he will be righteous or wicked.
This is untrue. Each person is fit to be righteous like Moses, our teacher, or wicked, like Jeroboam. [Similarly,] he may be wise or foolish, merciful or cruel, miserly or generous, or [acquire] any other character traits. There is no one who compels him, sentences him, or leads him towards either of these two paths. Rather, he, on his own initiative and decision, tends to the path he chooses.
This was [implied by the prophet,] Jeremiah who stated [Eichah 3:38: "From the mouth of the Most High, neither evil or good come forth." Accordingly, it is the sinner, himself, who causes his own loss.
Therefore, it is proper for a person to cry and mourn for his sins and for what he has done to his soul, the evil consequences, he brought upon it. This is implied by the following verse [ibid.:39]: "Of what should a living man be aggrieved? [A man of his sins.]"
[The prophet] continues explaining, since free choice is in our hands and our own decision [is what prompts us to] commit all these wrongs, it is proper for us to repent and abandon our wickedness, for this choice is presently in our hand. This is implied by the following verse [ibid.:40]: "Let us search and examine our ways and return [to God]."