How to display the input box next to the label in a form?
you can do this with css float

A more difficult ways that render the items via php preprocessing before css adjusts the layout) would be to create a php template file and use theme functions for the form in your theme

Here is tutorial that uses both methods http://www.jaypan.com/tutorial/themeing-drupal-7-forms-including-css-and-js

also, it depends on what kind of form you are theming. Here is another example for webforms https://drupal.org/node/1157306