I'm a beginner at piano. When practising is it best to learn how to play each hand separately at first and then put them together, or to practice the whole thing? Or does it not matter?
When you are first learning something, you need to be able to concentrate on just that single thing. This isn't something that is isolated to learning a piece of music. If you isolate just the single hand, you'll be able to learn it faster, without the distraction of the other hand.
Once you can play each hand by itself, start out at a slow tempo putting both hands together. Improve your speed as you are able.
If you are a complete beginner, you should be focusing on playing only one handed pieces until the note reading and playing ability is reasonable. After that, it depends on the nature of the piece. For example, a study which focuses on right hand dexterity and simple left hand accompaniment could possibly be played all together right at the start. A slow piece with a low degree of technical difficulty but higher expression and feeling can certainly be played hands together at the start.
On the other hand, a piece with the hands playing two complex parts such as a fugue should be practised extensively hands separately, and then combined at a slow speed as mentioned above.
A simple rule of thumb is that if you are struggling to play the piece in terms of technicality (hitting the notes) then you should probably not play together straight away.