When the line is pulled low, the driver pin (SCL on master, or SDA on master or slave) supplies current V/R to do that; so if it's a 10k resistor from 5V, the driver will need to sink 0.5 mA.
A larger resistor means less current is needed, but the line will pull up more slowly (especially on a long line) and this may limit your rate. A smaller resistor pulls up faster, but at some point you'll burn out the driver pin (check the data sheet). 3.3K to 10K is probably fine; if it's 3.3V maybe 2.2K-4.7K
It doesn't matter much where you put them electrically, but near the master is better if the cable might be disconnected; or you could put e.g. a 10k pullup at each end, instead of a single 4k7, which will keep both ends happy when the cable is disconnected.
Generally, for cable lengths to +-20cm, SCL at 100kHz will be happy with 10k. With increasing frequency and/or length, you may go as low as 1k.