number -= 1000; is a shorthand way for writing number = number - 1000;. It reduces the value of the variable by the amount on the right. The same applies to roman += "M";, which appends the string "M" to the end of roman.
The idea of converting integer to roman number is easy.
There is only one rule: Biggest number comes first.
By knowing this, we could model the system like this:
M = 1000
CM = 900
D = 500
CD = 400
C = 100
XC = 90
L = 50
XL = 40
X = 10
IX = 9
V = 5
IV = 4
I = 1
So that by converting an integer to roman number, we search the biggest number the integer is greater than or equal to in the above list. Record the roman digits, and subtract the integer, and repeat above process until the integer reaches 0.