Ok, here's (almost) everything you need:
simulate this circuit – Schematic created using CircuitLab
The Arduino uses an ATMEGA MCU (most of the AVRs have similar specs so it's not critical) so the datasheet has the relevant informations:
At 5V supply the output port HIGH voltage is at least 4.2V, with 20mA load
Still a 5V, the output port LOW voltage is at most 0.7V, with 20mA load
Since they quote the current at 20mA it's safe to assume that the current is available (up to 400mA total for the chip, as in the absolute maximums).
From the BC547 datasheet you can see that:
Maximum current capability is 100mA (the size of your relay coil)
DC current gain (hFE) at 2mA is at least 110
Base emitter saturation is typically 0.7V
Base emitter on voltage could go low at 0.55V (this is a beginner's trap)
Now, for the calculations: you want to put some mA in the base with the GPIO high: so you have a 4.2V source, the base resistore and the B-E junction (which is substantially a diode for this purpose, and drops 0.7V)
You then leave with at lease 3.5V on the resistor to drop. The proposed 1k resistor limits the current to about 3.5mA (minimum). That, multiplied by the hFA gives a potential 350mA of collector current which is enough (as in, if you try to pull more than 100mA the BJT dies). So even a slightly larger resistor will work (not too much however)
Now, for the above mentioned trap: if you are really unlucky you could have an AVR with a very high low output (0.7V) and a BJT with a very low VBE (0.55V). So the relay could actually trigger when the GPIO is low!
For that reason it's useful to add another resistor between base and emitter to shunt the excess current. The calculation is not immediate (think a resistor in parallel to the B-E junction diode). However a 10k resistor is useful and traditional for many decades.