Find amount of elements greater then number k in a BST
You can do it in $O(h)$ time only if you know some additional information at every node about the subtree rooted at that node. (Maybe @greybeard is suggesting the same in the comments). For example:
Suppose $x$ is any node in the tree, and suppose you know the number of nodes in the sub-tree rooted at $x$. Let us call this variable &quot;x.total&quot;. Then, the following algorithm works in $O(h)$ time:
fun(root,K) // It returns the number of elements greter than K
---if (root = NULL)
------- return 0; 
---if(root.value &gt; K)
-------- return fun(root.left_child,K) + 1 + root.right_child.total
---else
-------- return fun(root.right_child,K) 

The correctness of the above algorithm follows due to the fact that the given tree is a Binary Search tree (BST).
Moreover, you can maintain the extra information (i.e, x.total) for all nodes by traversing the tree only once. You can use DFS procedure for the same. Thus, the preprocessing time is only $O(n)$. And, the query time complexity would be just $O(h)$.

If you do not store any kind of extra information, then you can not do better than $O(n)$. For example: suppose the tree contains only positive elements and the query is for $K =  0$. Then, this query is the same as finding the total number of elements in the tree, which requires you to traverse every node and it essentially requires $\Omega(n)$ time.