When a shinobi executes a jutsu, he/she is required to gather an amount of chakra to release the technique. This is called chakra cost. Any shinobi from any rank can learn a jutsu but as long as he/she has enough chakra to pull it off. If not, it is pointless to learn such a difficult jutsu when the shinobi cannot execute the technique. Here is a chart which tells the essentials costs of chakra for each jutsu rank. It doesn't have to be exact, just almost the amount.
Note; One jutsu cannot take up all your chakra.
E rank - 0 to 100
D rank - 100 - 900
C rank - 1000 - 4000
B rank - 5000 - 9500
A rank - 10,000 - 50,000
S rank - 50,000 - 70,000
There is another thing called training cost. Training cost is when the shinobi learns the jutsu instead of creating the jutsu and claiming it's his/hers. It wouldn't be fair because there is no role playing information of the shinobi, 'creating and processing' the jutsu. So in that case, if any shinobi wishes to learn a jutsu, they have to train by post. The numbers in term is how much training posts you have to do. Same thing, here's a chart.
E rank - 1 Post
D rank - 2 - 4 Posts
C rank - 4 - 6 Posts
B rank - 6 - 7 Posts
A rank - 8 - 9 Posts
S rank - 10 Posts