Is 2 years too young? She hit her baby brother and I'm not sure she really will understand th concept of time-out yet.
As far as I understand it, when time outs become appropriate depends on what you are looking for from the time out. While you can give a child as young as 12 months a time out, at that age the time out serves more to give your child a moment to calm down rather than as a consequence for bad behavior. A time out for the under-2 year old is designed to provide a calming moment. Because your child probably doesn't understand sitting still at such a young age, it may be more appropriate to provide a "time in" where you sit with your child as calmly hold them until they calm down. Somewhere between two and three years of age toddlers develop the ability to connect the idea of time out as consequence. Language development usually signals the development of memory and the understanding required to "get" time out. (source). Dr. Sears recommends starting time out at 18 months and expects that toddlers will understand it by 2. (source).
For toddlers many developmental experts recommend natural consequences rather than or along with timeouts. Pediatrician Dr. Terry Brazleton suggests this in his Discipline: the Brazleton Way - here is a small summary of this thoughts on discipline. Magda Gerber also recommended this approach. Love and Logic also has some ideas for logical consequences among other things.
If you see your child about to hit, then first use a verbal command. "Gentle touching only!" If you know your child won't listen than physically prevent your child from hitting if you can. "I can't let you hit your baby brother." Do not underestimate the power of simply consistently setting and enforcing limits here. It is critical, as this blog post explains. Here is a further example of one way to set limits when it comes to hitting. If your child manages to hit her brother anyway then wrap her in a big bear hug and say, "I know that you [thought it would be fun to hit/were upset and overwhelmed and hit], but I can't let you do that." Then hold your child as described in this excellent answer on ending hitting. This is a logical consequence for hitting implemented by you - your daughter hits, you prevent her from using her arms for a enough seconds to seem like eternity to a toddler. The fact that the consequence (having her arms held) relates to the action (using her arms improperly to hit) will help her connect the dots.
Each of my children have been different, but I've started giving time-outs from the time they can go up and down stairs safely and understand simple three word instructions, which has typically happened before 2 years old. The stairs thing is simply because our time-outs are on the bottom step of the stairs, and there's little point in making time-outs dangerous.
Children may not understand action-consequence explicitly, but children as young as one can and do learn sign languages that get them rewards, so they are certainly capable of learning that hitting a person results in them being set on the stairs, and getting up from the stairs without permission results in them being put on the stairs again.
Time-outs can be effective at very young ages.
However, time-outs are further up on the scale of escalation for my family. Particularly at that young age we prefer to talk to them, and we will only remove them from the situation only if we've told them not to perform the bad action and they continue to do so.
It doesn't seem until age 3 or 4 when they are purposefully engaging in bad behavior to the degree that we have to provide a punishment that discourages the behavior.
Whatever you do, be very, very consistent. At this young age they will not learn and remember as quickly if they can't count on you reacting exactly the same each time you work with them on a new pattern or behavior.
A good general rule for timeouts is 1 minute per age of the child.
A timeout isn't supposed to be treated as a "punishment", but a way to remove the child from the problem situation.
At very young ages, like 1 or 2, it's long enough to (a) calm them down a bit, and (b) get them used to the concept (introducing it later can be more difficult without starting early). They may not understand what it's for, but it can still be effective even if they don't understand it.