Go to the border and just stand somewhere nearby; cars will be moving slowly. Be careful not to hitchhike too close to the border as there are many Guardia Civil (police formed by Franco) and they are not really kind to hitchhikers.
Try hitching at Europa Point! There are many tourists who are at least driving you back to the city centre. We got lucky and got a hitch further to Tarifa with the first car we asked!
If you're trying to hitch a sailboat to the Canary Islands or further to the Caribbean, go to the marina in La Línea. It's way better than the one in Gibraltar, as most travelling sailors are stopping in La Línea, in Gibraltar you have mostly residents.
Do not forget to buy everything that you need in La Linea, because food is 2-4 times more expensive in Gibraltar than in La Linea. There is a lot of big supermarkets and some of them works 24 hours, for example Carrefour (Avenida de la Colonia).
Cigarettes, tobacco and strong alcohol is cheaper in Gibraltar than in other Sсhengen countries, because taxes is very small.
Nazareth House is a kitchen for the poor where you get coffee and food from Monday til Friday 10-12. You can also take a shower and borrow a book.