What you are looking for is profiling:
In software engineering, profiling ("program profiling", "software profiling") is a form of dynamic program analysis that measures, for example, the space (memory) or time complexity of a program, the usage of particular instructions, or frequency and duration of function calls. The most common use of profiling information is to aid program optimization.
There are several such applications. Sometimes, these are built into the IDE itself. The netbeans ide is one such tool that has a profiler built in.

Another such tool is visual vm.

Profilers can work in different ways - and one should be aware of the differences. One approach is every second to take a snapshot of the threads running and see what methods are currently being invoked for each thread. This uses a sampling of what is out there.
The other approach is to instrument the java bytecode to report back the start and stop time to another application.
Writing a profiler is not terribly difficult for one skilled java. IBM has an article on writing your own profiler (with source code!). This one is based on the Java Interactive Profiler.
There are a multitude of profilers out there - both free and commercial (how about a profiler hooked up to running JVM instances that can report back to you (email or some other notification) when particular methods exceed the expected runtime? or hooked up to a program that reports back when web requests took too long - have the historical profile for that request saved off for later inspection?). You just have to know what you are looking for to start finding them and go from there.
Once you've got the profiler, you're on to interpreting the profiling results.