You don't need to "sit around" for two hours until it's time to leave. Here's a few things you can do instead:-
Let your manager know
It doesn't sound like your manager is used to your work-rate. Take this as an opportunity to impress your new employers. People with a reputation for finishing work ahead of time are valuable - and in software, very rare. Let your manager know that you're free and ready to be assigned your next task.
Alternately you may want to see if you can set up a system where you can "pull" work, rather than have your manager "push" it to you. To start with you can make sure that your manager keeps your to-do list sufficiently long that you never run out, but eventually you might want to influence the working procedures of your workplace towards a more agile approach (where your team has a to-do list, and you grab the item at the top when you're free).
Find ways to generate value yourself
If you think your manager will just give you make-work to get you out of their hair, or if you don't like the sound of asking for more, then why don't you look for some ways you can generate value for the company yourself? See if you can automate a build or a deployment. Introduce a tool to automatically enforce a policy usually checked by hand. There are usually thousands of things that could get done that we never get around to.
Use your judgement, though. You're likely to want to clear this kind of thing with your manager anyway.
Improve your skills
Read a book, explore an API, dig into the source control logs of an open-source component your project uses.
Learn about the domain you're working in. Are there any useful documents on your intranet? Regulations that it would be useful for you to understand?
Good employers will appreciate your initiative, though you may wish to exercise caution before indulging yourself excessively.