What kind of resin can be used to fill a gap in a piece of wood?
An epoxy resin, or polyepoxide: a resin mixed with a hardener.
This can be used both for filling in gaps in wood as well as encasing wood.


  Epoxy can give wood a waterproof, resilient finish. In most cases, it is an ideal coating for wood projects that will be exposed to moisture or wear. (source)


Some epoxies are intended for use with wood, or, more specifically, wooden furniture (called 'tabletop epoxy', for example), and will be clearer, more UV-resistant, and less prone to forming bubbles.

Whether coloured or clear is a matter of taste.

If you're thinking of casting the entire piece of wood in resin, you can calculate how much you are going to need here (NB that's a commercial website).