What is JNDI ?
It stands for Java Naming and Directory Interface. A Google search would have told you that and more.
What is its basic use?
JNDI allows distributed applications to look up services in an abstract, resource-independent way.
When it is used?
It's an interface (actually more than one) that offers several directory services (e.g. to discover and to lookup an object by name). Like any interface, you can have different implementations (EJB, LDAP, DNS, etc) and you can to use what is more suitable for solving your problem. The design benefits are the ones related to programming against the interface(if you change the implementation the client code that use the API don't needs to change)