You need to define member functions in a header file, because when instantiating a template, the compiler needs to have access to the implementation of the methods, to instantiate them with the template argument.
In your example:
template
class Graph {
public:
void InsertVertex(T val) {
Node *temp = new Node(val);
if(head == NULL)
head = temp;
// ...
}
// ...
private:
Node *head;
};